# HG changeset patch # User Luke Schierer # Date 1073190437 0 # Node ID 58af482c89f7a9834c633c042c53e3089ded5ef4 # Parent ad5c8f01882b4680475c4c11249f571f1e92bbc6 [gaim-migrate @ 8659] " When any error condition is returned by a socks5 proxy, the debug window just shows "Bad data". This patch shows the error message corresponding to the returned error code, so that the user may know why the socks5 proxy is refusing to process the request. Background: I'd been trying to establish why I couldn't connect to MSN through SOCKS5. Adding this patch enabled me to see that it wsan't a bug in gaim as I'd originally thought, but that the proxy server I was using was configured to deny connections to nexus.passport.com:443." --Gavan Fantom (gavan) committer: Tailor Script diff -r ad5c8f01882b -r 58af482c89f7 src/proxy.c --- a/src/proxy.c Sat Jan 03 16:22:44 2004 +0000 +++ b/src/proxy.c Sun Jan 04 04:27:17 2004 +0000 @@ -59,6 +59,18 @@ } GaimIOClosure; +const char* socks5errors[] = { + "succeeded\n", + "general SOCKS server failure\n", + "connection not allowed by ruleset\n", + "Network unreachable\n", + "Host unreachable\n", + "Connection refused\n", + "TTL expired\n", + "Command not supported\n", + "Address type not supported\n" +}; + /************************************************************************** * Proxy structure API **************************************************************************/ @@ -1316,7 +1328,10 @@ return; } if ((buf[0] != 0x05) || (buf[1] != 0x00)) { - gaim_debug(GAIM_DEBUG_ERROR, "socks5 proxy", "Bad data.\n"); + if ((buf[0] == 0x05) && (buf[1] < 0x09)) + gaim_debug(GAIM_DEBUG_ERROR, "socks5 proxy", socks5errors[buf[1]]); + else + gaim_debug(GAIM_DEBUG_ERROR, "socks5 proxy", "Bad data.\n"); close(source); if (phb->account == NULL ||