mirror of
https://github.com/curl/curl.git
synced 2026-05-16 07:06:20 +03:00
cf-ip-happy: mention unix domain path, not port number
In the connect error message if a unix domain socket was used. Reported-by: kuchara on github Ref: #18748 Closes #18749
This commit is contained in:
parent
34b1e146e4
commit
b5ffe30e5b
1 changed files with 19 additions and 10 deletions
|
|
@ -627,26 +627,35 @@ static CURLcode is_connected(struct Curl_cfilter *cf,
|
|||
|
||||
{
|
||||
const char *hostname, *proxy_name = NULL;
|
||||
int port;
|
||||
char viamsg[160];
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
if(conn->bits.socksproxy)
|
||||
proxy_name = conn->socks_proxy.host.name;
|
||||
else if(conn->bits.httpproxy)
|
||||
proxy_name = conn->http_proxy.host.name;
|
||||
#endif
|
||||
hostname = conn->bits.conn_to_host ?
|
||||
conn->conn_to_host.name : conn->host.name;
|
||||
hostname = conn->bits.conn_to_host ? conn->conn_to_host.name :
|
||||
conn->host.name;
|
||||
|
||||
if(cf->sockindex == SECONDARYSOCKET)
|
||||
port = conn->secondary_port;
|
||||
else if(cf->conn->bits.conn_to_port)
|
||||
port = conn->conn_to_port;
|
||||
#ifdef USE_UNIX_SOCKETS
|
||||
if(conn->unix_domain_socket)
|
||||
msnprintf(viamsg, sizeof(viamsg), "over %s", conn->unix_domain_socket);
|
||||
else
|
||||
port = conn->remote_port;
|
||||
#endif
|
||||
{
|
||||
int port;
|
||||
if(cf->sockindex == SECONDARYSOCKET)
|
||||
port = conn->secondary_port;
|
||||
else if(cf->conn->bits.conn_to_port)
|
||||
port = conn->conn_to_port;
|
||||
else
|
||||
port = conn->remote_port;
|
||||
msnprintf(viamsg, sizeof(viamsg), "port %u", port);
|
||||
}
|
||||
|
||||
failf(data, "Failed to connect to %s port %u %s%s%safter "
|
||||
failf(data, "Failed to connect to %s %s %s%s%safter "
|
||||
"%" FMT_TIMEDIFF_T " ms: %s",
|
||||
hostname, port,
|
||||
hostname, viamsg,
|
||||
proxy_name ? "via " : "",
|
||||
proxy_name ? proxy_name : "",
|
||||
proxy_name ? " " : "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue