diff --git a/lib/socks.c b/lib/socks.c index 6ae98184d16ac640f8fa9309bd290d2b8f66c560..f08326dbecd744d1cb3ce2d236bddffbde3926da 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -398,9 +398,9 @@ CURLcode Curl_SOCKS5(const char *proxy_user, /* RFC1928 chapter 5 specifies max 255 chars for domain name in packet */ if(!socks5_resolve_local && hostname_len > 255) { - infof(conn->data, "SOCKS5: server resolving disabled for hostnames of " - "length > 255 [actual len=%zu]\n", hostname_len); - socks5_resolve_local = TRUE; + failf(data, "SOCKS5: the destination hostname is too long to be " + "resolved remotely by the proxy."); + return CURLE_COULDNT_RESOLVE_HOST; } /* get timeout */ @@ -605,7 +605,7 @@ CURLcode Curl_SOCKS5(const char *proxy_user, if(!socks5_resolve_local) { socksreq[len++] = 3; /* ATYP: domain name = 3 */ - socksreq[len++] = (char) hostname_len; /* address length */ + socksreq[len++] = (unsigned char) hostname_len; /* address length */ memcpy(&socksreq[len], hostname, hostname_len); /* address str w/o NULL */ len += hostname_len; msnprintf(dest, sizeof(dest), "%s:%d", hostname, remote_port);