Mercurial > hg > th-libs
changeset 130:32dcabfc2644
Add some informative messages to SOCKS 5 authentication steps.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 23 Jun 2014 16:14:12 +0300 |
parents | aa2d608fb3f3 |
children | 6624893ad528 |
files | th_network.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; }