# HG changeset patch # User Matti Hamalainen # Date 1403529252 -10800 # Node ID 32dcabfc2644fe9ff4f4ed7326963f0cba86e1ed # Parent aa2d608fb3f3101444d0a04d6963416e0ce9fd2e Add some informative messages to SOCKS 5 authentication steps. diff -r aa2d608fb3f3 -r 32dcabfc2644 th_network.c --- a/th_network.c Sun Jun 22 07:23:54 2014 +0300 +++ b/th_network.c Mon Jun 23 16:14:12 2014 +0300 @@ -447,6 +447,7 @@ if (auth == SOCKS5_AUTH_USER) { // Attempt user/pass authentication (RFC 1929) + th_conn_msg(conn, THLOG_INFO, "Attempting SOCKS 5 user/pass authentication.\n"); th_growbuf_clear(&buf); th_growbuf_put_u8(&buf, 0x01); @@ -476,16 +477,20 @@ { err = THERR_AUTH_FAILED; th_conn_err(conn, err, - "SOCKS 5 proxy user/pass authentication failed! Code %d.\n", *ptr); + "SOCKS 5 proxy user/pass authentication failed! Code 0x%02x.\n", *ptr); goto out; } } else - if (auth != SOCKS5_AUTH_NONE) + if (auth == SOCKS5_AUTH_NONE) + { + th_conn_msg(conn, THLOG_INFO, "Using no authentication for SOCKS 5.\n"); + } + else { err = THERR_NOT_SUPPORTED; th_conn_err(conn, err, - "Proxy server chose an unsupported SOCKS 5 authentication method %d.\n", + "Proxy server chose an unsupported SOCKS 5 authentication method 0x%02x.\n", auth); goto out; }