]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Handle socket errors on half-open channels.
authorSimon Tatham <anakin@pobox.com>
Sun, 8 Sep 2013 13:20:49 +0000 (13:20 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 8 Sep 2013 13:20:49 +0000 (13:20 +0000)
commit043a762b5ff1d765cb6e69bb988a43e9ca79dd2f
treebfbcccb6cdbe0d9fb3a201702d1ff361de5818db
parent8e7b0d0e4b75dbe5239dd7c4197cc60885196a6e
Handle socket errors on half-open channels.

Anthony Ho reports that this can occur naturally in some situation
involving Windows 8 + IE 11 and dynamic port forwarding: apparently we
get through the SOCKS negotiation, send our CHANNEL_OPEN, and then
*immediately* suffer a local WSAECONNABORTED error before the server
has sent back its OPEN_CONFIRMATION or OPEN_FAILURE. In this situation
ssh2_channel_check_close was failing to notice that the channel didn't
yet have a valid server id, and sending out a CHANNEL_CLOSE anyway
containing 32 bits of uninitialised nonsense.

We now handle this by turning our half-open CHAN_SOCKDATA_DORMANT into
a half-open CHAN_ZOMBIE, which means in turn that our handler
functions for OPEN_CONFIRMATION and OPEN_FAILURE have to recognise and
handle that case, the former by immediately initiating channel closure
once we _do_ have the channel's server id to do it with.

[originally from svn r10039]
ssh.c