X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/bc06669bcf2c0d331e231d18c0e14023433f9e79..88ea89339783ee587180b645981967f6cb8bcd20:/proxy.c diff --git a/proxy.c b/proxy.c index 051beb7e..70da38c3 100644 --- a/proxy.c +++ b/proxy.c @@ -286,6 +286,15 @@ static int proxy_for_destination (SockAddr addr, char *hostname, int port, const char *exclude_list; /* + * Special local connections such as Unix-domain sockets + * unconditionally cannot be proxied, even in proxy-localhost + * mode. There just isn't any way to ask any known proxy type for + * them. + */ + if (addr && sk_address_is_special_local(addr)) + return 0; /* do not proxy */ + + /* * Check the host name and IP against the hard-coded * representations of `localhost'. */ @@ -464,6 +473,7 @@ Socket new_connection(SockAddr addr, char *hostname, conf_get_int(conf, CONF_addressfamily)); if (sk_addr_error(proxy_addr) != NULL) { ret->error = "Proxy error: Unable to resolve proxy host name"; + sfree(pplug); return (Socket)ret; } sfree(proxy_canonical_name); @@ -741,8 +751,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;