]> asedeno.scripts.mit.edu Git - PuTTY_svn.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)
commit0c2bb9a657f50087970589df363f5a21d0427b96
treebfbcccb6cdbe0d9fb3a201702d1ff361de5818db
parentc9482e09458a6c1981a02750e132562c2e8c143d
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.

git-svn-id: http://svn.tartarus.org/sgt/putty@10039 cda61777-01e9-0310-a592-d414129be87e
ssh.c