diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2016-08-20 20:07:10 +0200 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2016-08-20 20:07:10 +0200 |
commit | d1bfb1cf54d3e862581fb12590ee845da39869e4 (patch) | |
tree | c2f7fff3ad2b67d42a716e1f3ef1666885841b3a | |
parent | 8f7f5a8b0677f0260ed87b29fdf07dbe25151313 (diff) |
socks.c: improve verbose output of SOCKS5 connection sequence
-rw-r--r-- | lib/socks.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/socks.c b/lib/socks.c index b6bc4e17c..bee43ac2b 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -606,7 +606,6 @@ CURLcode Curl_SOCKS5(const char *proxy_name, saddr_in = (struct sockaddr_in*)(void*)hp->ai_addr; for(i = 0; i < 4; i++) { socksreq[len++] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[i]; - infof(data, "%d\n", socksreq[len-1]); } } #ifdef ENABLE_IPV6 @@ -629,6 +628,25 @@ CURLcode Curl_SOCKS5(const char *proxy_name, hostname); return CURLE_COULDNT_RESOLVE_HOST; } + else { + if(socksreq[3] == 1) { + infof(data, "SOCKS5 connect to %d.%d.%d.%d (locally resolved)\n", + (unsigned char)socksreq[4], (unsigned char)socksreq[5], + (unsigned char)socksreq[6], (unsigned char)socksreq[7]); + } + else if(socksreq[3] == 4) { + infof(data, "SOCKS5 connect to %02x%02x:%02x%02x:%02x%02x:%02x%02x:" + "%02x%02x:%02x%02x:%02x%02x:%02x%02x (locally resolved)\n", + (unsigned char)socksreq[4], (unsigned char)socksreq[5], + (unsigned char)socksreq[6], (unsigned char)socksreq[7], + (unsigned char)socksreq[8], (unsigned char)socksreq[9], + (unsigned char)socksreq[10], (unsigned char)socksreq[11], + (unsigned char)socksreq[12], (unsigned char)socksreq[13], + (unsigned char)socksreq[14], (unsigned char)socksreq[15], + (unsigned char)socksreq[16], (unsigned char)socksreq[17], + (unsigned char)socksreq[18], (unsigned char)socksreq[19]); + } + } } socksreq[len++] = (unsigned char)((remote_port >> 8) & 0xff); /* PORT MSB */ |