diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index cc832f18bf2..ee60b36f5d7 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1087,6 +1087,7 @@ HttpSM::state_raw_http_server_open(int event, void *data) server_entry->vc = netvc = (NetVConnection *)data; server_entry->vc_type = HTTP_RAW_SERVER_VC; t_state.current.state = HttpTransact::CONNECTION_ALIVE; + ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr()); netvc->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_no_activity_timeout_out)); netvc->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_active_timeout_out)); @@ -1716,6 +1717,7 @@ HttpSM::state_http_server_open(int event, void *data) pending_action = nullptr; milestones[TS_MILESTONE_SERVER_CONNECT_END] = Thread::get_hrtime(); HttpServerSession *session; + NetVConnection *netvc = nullptr; switch (event) { case NET_EVENT_OPEN: @@ -1725,9 +1727,11 @@ HttpSM::state_http_server_open(int event, void *data) session->sharing_pool = static_cast(t_state.http_config_param->server_session_sharing_pool); session->sharing_match = static_cast(t_state.txn_conf->server_session_sharing_match); + netvc = static_cast(data); session->attach_hostname(t_state.current.server->name); - session->new_connection(static_cast(data)); + session->new_connection(netvc); session->state = HSS_ACTIVE; + ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr()); // If origin_max_connections or origin_min_keep_alive_connections is set then we are metering // the max and or min number of connections per host. Transfer responsibility for this to the diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 24171cb171b..2832495458d 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -3608,9 +3608,10 @@ HttpTransact::retry_server_connection_not_open(State *s, ServerState_t conn_stat // record the failue // ////////////////////////////////////////// if (0 == s->current.attempts) { - Log::error("CONNECT:[%d] could not connect [%s] to %s for '%s'", s->current.attempts, + Log::error("CONNECT:[%d] could not connect [%s] to %s for '%s' connect_result=%d src_port=%d", s->current.attempts, HttpDebugNames::get_server_state_name(conn_state), - ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)), url_string ? url_string : ""); + ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)), url_string ? url_string : "", + s->current.server->connect_result, ntohs(s->current.server->src_addr.port())); } if (url_string) {