X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/7983f47ed4d055fd67c42ea5d9a1ddb8801d3ad9..239b3b3629cc9e149dbc375ae2c42dc6d4f35c49:/proxy.c diff --git a/proxy.c b/proxy.c index 7b42622b..b9ed5489 100644 --- a/proxy.c +++ b/proxy.c @@ -314,6 +314,12 @@ Socket new_connection(SockAddr addr, char *hostname, ret->remote_addr = addr; ret->remote_port = port; + /* XXX review these initialisations, and initialise other fields + * in Proxy_Socket structure */ + ret->error = NULL; + ret->pending_flush = 0; + ret->freeze = 0; + bufchain_init(&ret->pending_input_data); bufchain_init(&ret->pending_output_data); bufchain_init(&ret->pending_oob_output_data); @@ -1005,7 +1011,7 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change) if (p->state == 4) { /* TODO: Handle GSSAPI authentication */ - plug_closing(p->plug, "Network error: We don't support GSSAPI authentication", + plug_closing(p->plug, "Proxy error: We don't support GSSAPI authentication", PROXY_ERROR_GENERAL, 0); return 1; } @@ -1026,7 +1032,7 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change) sk_write(p->sub_socket, userpwbuf, ulen + plen + 3); p->state = 7; } else - plug_closing(p->plug, "Network error: Server chose " + plug_closing(p->plug, "Proxy error: Server chose " "username/password authentication but we " "didn't offer it!", PROXY_ERROR_GENERAL, 0); @@ -1035,14 +1041,14 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change) if (p->state == 6) { /* TODO: Handle CHAP authentication */ - plug_closing(p->plug, "Network error: We don't support CHAP authentication", + plug_closing(p->plug, "Proxy error: We don't support CHAP authentication", PROXY_ERROR_GENERAL, 0); return 1; } } - plug_closing(p->plug, "Network error: Unexpected proxy error", + plug_closing(p->plug, "Proxy error: Unexpected proxy error", PROXY_ERROR_UNEXPECTED, 0); return 1; } @@ -1256,7 +1262,7 @@ int proxy_telnet_negotiate (Proxy_Socket p, int change) return 1; } - plug_closing(p->plug, "Network error: Unexpected proxy error", + plug_closing(p->plug, "Proxy error: Unexpected proxy error", PROXY_ERROR_UNEXPECTED, 0); return 1; }