1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 19:42:48 -05:00

Remove PROXY_CHANGE_{SENT,CLOSING,ACCEPTING}.

These were just boilerplate in all the proxy negotiation functions:
every negotiator had to contain a handler for each of these events,
and they all handled them in exactly the same way. Remove them and
centralise the handling in the shared code.

A long time ago, some of these event codes were added with purpose in
mind. PROXY_CHANGE_CLOSING was there to anticipate the possibility
that you might need to make multiple TCP connections to the proxy
server (e.g. retrying with different authentication) before
successfully getting a connection you could use to talk to the
ultimate destination. And PROXY_CHANGE_ACCEPTING was there so that we
could use the listening side of SOCKS (where you ask the proxy to open
a listening socket on your behalf). But neither of them has ever been
used, and now that the code has evolved, I think probably if we do
ever need to do either of those things then they'll want to be done
differently.
This commit is contained in:
Simon Tatham
2021-11-19 10:42:20 +00:00
parent 1bf93289c9
commit 23c64fa00e
2 changed files with 4 additions and 149 deletions

View File

@ -39,10 +39,7 @@ struct ProxySocket {
*/
#define PROXY_CHANGE_NEW -1
#define PROXY_CHANGE_CLOSING 0
#define PROXY_CHANGE_SENT 1
#define PROXY_CHANGE_RECEIVE 2
#define PROXY_CHANGE_ACCEPTING 3
/* something has changed (a call from the sub socket
* layer into our Proxy Plug layer, or we were just
@ -57,19 +54,11 @@ struct ProxySocket {
* (for use by proxy's negotiate function)
*/
/* closing */
PlugCloseType closing_type;
const char *closing_error_msg;
/* receive */
bool receive_urgent;
const char *receive_data;
int receive_len;
/* accepting */
accept_fn_t accepting_constructor;
accept_ctx_t accepting_ctx;
/* configuration, used to look up proxy settings */
Conf *conf;