MCPcopy Create free account
hub / github.com/apache/trafficserver / error_log_connection_failure

Method error_log_connection_failure

src/proxy/http/HttpTransact.cc:3821–3846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3819}
3820
3821void
3822HttpTransact::error_log_connection_failure(State *s, ServerState_t conn_state)
3823{
3824 ip_port_text_buffer addrbuf;
3825 TxnDbg(dbg_ctl_http_trans, "[%d] failed to connect [%d] to %s", s->current.retry_attempts.get(), conn_state,
3826 ats_ip_nptop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)));
3827
3828 if (s->current.server->had_connect_fail()) {
3829 char *url_str = s->hdr_info.client_request.url_string_get(&s->arena);
3830 int host_len = 0;
3831 const char *host_name_ptr = "";
3832 if (s->unmapped_url.valid()) {
3833 host_name_ptr = s->unmapped_url.host_get(&host_len);
3834 }
3835 std::string_view host_name{host_name_ptr, size_t(host_len)};
3836 swoc::bwprint(error_bw_buffer,
3837 "CONNECT: attempt fail [{}] to {} for host='{}' "
3838 "connection_result={::s} error={::s} retry_attempts={} url='{}'",
3839 HttpDebugNames::get_server_state_name(conn_state), s->current.server->dst_addr, host_name,
3840 swoc::bwf::Errno(s->current.server->connect_result), swoc::bwf::Errno(s->cause_of_death_errno),
3841 s->current.retry_attempts.get(), swoc::bwf::FirstOf(url_str, "<none>"));
3842 Log::error("%s", error_bw_buffer.c_str());
3843
3844 s->arena.str_free(url_str);
3845 }
3846}
3847
3848///////////////////////////////////////////////////////////////////////////////
3849// Name : retry_server_connection_not_open

Callers

nothing calls this directly

Calls 11

ErrnoClass · 0.85
FirstOfFunction · 0.85
errorFunction · 0.85
had_connect_failMethod · 0.80
url_string_getMethod · 0.80
str_freeMethod · 0.80
ats_ip_nptopFunction · 0.50
getMethod · 0.45
validMethod · 0.45
host_getMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected