Skip to content

Commit

Permalink
Remove obsolete cdn_ HttpTransact vars (#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinrich authored Sep 16, 2020
1 parent 5da4ca3 commit 05eca2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
27 changes: 6 additions & 21 deletions proxy/http/HttpTransact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,13 @@ how_to_open_connection(HttpTransact::State *s)
break;
}
s->cdn_saved_next_action = HttpTransact::SM_ACTION_ORIGIN_SERVER_OPEN;
HttpTransact::StateMachineAction_t connect_next_action = HttpTransact::SM_ACTION_ORIGIN_SERVER_OPEN;
// Setting up a direct CONNECT tunnel enters OriginServerRawOpen. We always do that if we
// are not forwarding CONNECT and are not going to a parent proxy.
if (s->method == HTTP_WKSIDX_CONNECT) {
if (s->txn_conf->forward_connect_method == 1 || s->parent_result.result == PARENT_SPECIFIED) {
s->cdn_saved_next_action = HttpTransact::SM_ACTION_ORIGIN_SERVER_OPEN;
} else {
s->cdn_saved_next_action = HttpTransact::SM_ACTION_ORIGIN_SERVER_RAW_OPEN;
if (s->txn_conf->forward_connect_method != 1 && s->parent_result.result != PARENT_SPECIFIED) {
connect_next_action = HttpTransact::SM_ACTION_ORIGIN_SERVER_RAW_OPEN;
}
}
Expand All @@ -774,9 +772,7 @@ how_to_open_connection(HttpTransact::State *s)
HttpTransactHeaders::convert_request(s->current.server->http_version, &s->hdr_info.server_request);
}
ink_assert(s->cdn_saved_next_action == HttpTransact::SM_ACTION_ORIGIN_SERVER_OPEN ||
s->cdn_saved_next_action == HttpTransact::SM_ACTION_ORIGIN_SERVER_RAW_OPEN);
return s->cdn_saved_next_action;
return connect_next_action;
}
/*****************************************************************************
Expand Down Expand Up @@ -2020,19 +2016,8 @@ HttpTransact::OSDNSLookup(State *s)
// After SM_ACTION_DNS_LOOKUP, goto the saved action/state ORIGIN_SERVER_(RAW_)OPEN.
// Should we skip the StartAccessControl()? why?

if (s->cdn_remap_complete) {
TxnDebug("cdn", "This is a late DNS lookup. We are going to the OS, "
"not to HandleFiltering.");

ink_assert(s->cdn_saved_next_action == SM_ACTION_ORIGIN_SERVER_OPEN ||
s->cdn_saved_next_action == SM_ACTION_ORIGIN_SERVER_RAW_OPEN);
TxnDebug("cdn", "outgoing version -- (pre conversion) %d", s->hdr_info.server_request.m_http->m_version);
(&s->hdr_info.server_request)->version_set(HTTPVersion(1, 1));
HttpTransactHeaders::convert_request(s->current.server->http_version, &s->hdr_info.server_request);
TxnDebug("cdn", "outgoing version -- (post conversion) %d", s->hdr_info.server_request.m_http->m_version);
TRANSACT_RETURN(s->cdn_saved_next_action, nullptr);
} else if (DNSLookupInfo::OS_Addr::OS_ADDR_USE_CLIENT == s->dns_info.os_addr_style ||
DNSLookupInfo::OS_Addr::OS_ADDR_USE_HOSTDB == s->dns_info.os_addr_style) {
if (DNSLookupInfo::OS_Addr::OS_ADDR_USE_CLIENT == s->dns_info.os_addr_style ||
DNSLookupInfo::OS_Addr::OS_ADDR_USE_HOSTDB == s->dns_info.os_addr_style) {
// we've come back after already trying the server to get a better address
// and finished with all backtracking - return to trying the server.
TRANSACT_RETURN(how_to_open_connection(s), HttpTransact::HandleResponse);
Expand Down
6 changes: 0 additions & 6 deletions proxy/http/HttpTransact.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,6 @@ class HttpTransact
// able to defer some work in building the request
TransactFunc_t pending_work = nullptr;

// Sandbox of Variables
StateMachineAction_t cdn_saved_next_action = SM_ACTION_UNDEFINED;
void (*cdn_saved_transact_return_point)(State *s) = nullptr;
bool cdn_remap_complete = false;
bool first_dns_lookup = true;

HttpRequestData request_data;
ParentConfigParams *parent_params = nullptr;
std::shared_ptr<NextHopSelectionStrategy> next_hop_strategy = nullptr;
Expand Down

0 comments on commit 05eca2b

Please sign in to comment.