From 425b94fd77a3aa6158d08616f90a080f38a42625 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 16 Oct 2012 20:15:52 +0000 Subject: [PATCH] When a proxy negotiation function is called with PROXY_CHANGE_NEW, it should not call plug functions, because it's being called from within new_connection(), and the state on which the plug functions depend will not have been set up until new_connection() returns success. Instead, we set the error string in the Proxy_Socket, which will cause the same error message to be returned as a failure of new_connection(). git-svn-id: svn://svn.tartarus.org/sgt/putty@9689 cda61777-01e9-0310-a592-d414129be87e --- proxy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxy.c b/proxy.c index 3c81884d..bb89a176 100644 --- a/proxy.c +++ b/proxy.c @@ -750,8 +750,7 @@ int proxy_socks4_negotiate (Proxy_Socket p, int change) type = sk_addrtype(p->remote_addr); if (type == ADDRTYPE_IPV6) { - plug_closing(p->plug, "Proxy error: SOCKS version 4 does" - " not support IPv6", PROXY_ERROR_GENERAL, 0); + p->error = "Proxy error: SOCKS version 4 does not support IPv6"; return 1; } else if (type == ADDRTYPE_IPV4) { namelen = 0; -- 2.11.0