mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Send ProxyNegotiator output even when pn->done is set.
This fixes the Telnet proxy, which was the only one of the proxy types I forgot to test when I pushed the previous patch series, and therefore, naturally, the one I left a bug in: if a ProxyNegotiator returns both some output to be transmitted _and_ the 'done' flag, we were forgetting to do anything with the former. So the proxy command was being carefully constructed by TelnetProxyNegotiator, and then promptly dropped on the floor by the owning ProxySocket.
This commit is contained in:
parent
d8ecba71b7
commit
445bcd7030
@ -209,24 +209,27 @@ static void proxy_negotiate(ProxySocket *ps)
|
||||
{
|
||||
assert(ps->pn);
|
||||
proxy_negotiator_process_queue(ps->pn);
|
||||
if (ps->pn->done) {
|
||||
proxy_activate(ps);
|
||||
} else if (ps->pn->error) {
|
||||
|
||||
if (ps->pn->error) {
|
||||
char *err = dupprintf("Proxy error: %s", ps->pn->error);
|
||||
sfree(ps->pn->error);
|
||||
proxy_negotiator_cleanup(ps);
|
||||
plug_closing_error(ps->plug, err);
|
||||
sfree(err);
|
||||
return;
|
||||
} else if (ps->pn->aborted) {
|
||||
proxy_negotiator_cleanup(ps);
|
||||
plug_closing_user_abort(ps->plug);
|
||||
} else {
|
||||
while (bufchain_size(&ps->output_from_negotiator)) {
|
||||
ptrlen data = bufchain_prefix(&ps->output_from_negotiator);
|
||||
sk_write(ps->sub_socket, data.ptr, data.len);
|
||||
bufchain_consume(&ps->output_from_negotiator, data.len);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
while (bufchain_size(&ps->output_from_negotiator)) {
|
||||
ptrlen data = bufchain_prefix(&ps->output_from_negotiator);
|
||||
sk_write(ps->sub_socket, data.ptr, data.len);
|
||||
bufchain_consume(&ps->output_from_negotiator, data.len);
|
||||
}
|
||||
if (ps->pn->done)
|
||||
proxy_activate(ps);
|
||||
}
|
||||
|
||||
static void plug_proxy_receive(
|
||||
|
Loading…
Reference in New Issue
Block a user