[Commits] [SCM] claws branch, master, updated. 3.17.0-47-g9472330

ticho at claws-mail.org ticho at claws-mail.org
Thu Sep 6 23:16:13 CEST 2018


The branch, master has been updated
       via  9472330754c7ae216e84b5f74595b07f48dc38b2 (commit)
      from  1c069e3069d795a0a845d1f35b23c8a1250bce74 (commit)

Summary of changes:
 src/common/proxy.c |   21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)


- Log -----------------------------------------------------------------
commit 9472330754c7ae216e84b5f74595b07f48dc38b2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Sep 6 23:13:41 2018 +0200

    Show correct address:port in SOCKS5 proxy connection failure message.
    
    The address and port contained in the server response
    are what the proxy server has bound locally for the
    connection, not the destination address and port.

diff --git a/src/common/proxy.c b/src/common/proxy.c
index e790990..7a30030 100644
--- a/src/common/proxy.c
+++ b/src/common/proxy.c
@@ -254,25 +254,8 @@ gint socks5_connect(SockInfo *sock, const gchar *hostname, gushort port,
 		return -1;
 	}
 	if (socks_req[1] != 0) {
-		if (socks_req[3] == 1) { /* IPv4 address */
-			g_warning("socks5_connect: SOCKS5 connection to %u.%u.%u.%u:%u failed. (%u)", socks_req[4], socks_req[5], socks_req[6], socks_req[7], ntohs(*(gushort *)(socks_req + 8)), socks_req[1]);
-		} else if (socks_req[3] == 3) { /* Domain name */
-			gint hnlen = socks_req[4];
-			gchar *hn = malloc(hnlen + 1);
-			hn[hnlen] = '\0';
-			memcpy(hn, &socks_req[5], hnlen);
-			g_warning("socks5_connect: SOCKS5 connection to %s:%u failed. (%u)",
-					hn, ntohs(*(gushort *)(socks_req + 5 + hnlen)), socks_req[1]);
-			g_free(hn);
-		} else if (socks_req[3] == 4) { /* IPv6 address */
-			gint hnlen = 16;
-			gchar *hn = malloc(hnlen + 1);
-			hn[hnlen] = '\0';
-			memcpy(hn, &socks_req[4], hnlen);
-			g_warning("socks5_connect: SOCKS5 connection to IPv6 %s:%u failed. (%u)",
-					hn, ntohs(*(gushort *)(socks_req + 5 + hnlen)), socks_req[1]);
-			g_free(hn);
-		}
+		g_warning("socks5_connect: SOCKS5 connection to %s:%u failed. (%u)",
+				hostname, port, socks_req[1]);
 		return -1;
 	}
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list