1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix failure to close the outgoing socket.

A second bug in the area of clean SSH-connection closure: I was
setting the pending_close flag (formerly send_outgoing_eof) and
expecting that once the outgoing backlog was cleared it would cause a
socket closure. But of course the function that does that -
ssh_bpp_output_raw_data_callback() - will only get called if there
_is_ any outgoing backlog to be cleared! So if there was already no
backlog, I would set the pending_close flag and nothing would ever
check it again.

Fixed by manually re-queuing the callback that will check the backlog
and the pending_close flag.
This commit is contained in:
Simon Tatham 2018-10-01 21:01:59 +01:00
parent 1d162fa767
commit db188040ea

1
ssh.c
View File

@ -373,6 +373,7 @@ static void ssh_initiate_connection_close(Ssh ssh)
* schedule closing the network socket after they go out. */
ssh_bpp_handle_output(ssh->bpp);
ssh->pending_close = TRUE;
queue_idempotent_callback(&ssh->ic_out_raw);
/* Now we expect the other end to close the connection too in
* response, so arrange that we'll receive notification of that