Make logparse handle completely bogus channel numbers.

Previously it would throw a bunch of Perl undefined-variable-usage
warnings; now it cleanly detects the problem, dumps as much of the
message as it still reasonably can, and doesn't update any channel
states.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10036 cda61777-01e9-0310-a592-d414129be87e
Fix SSH2_MSG_CHANNEL_EXTENDED_DATA in logparse.

It looks as if it's never worked at all: it had a spurious second
printf, it completely forgot to allow for the uint32 type code that
SSH2_MSG_CHANNEL_DATA doesn't have, it accessed the channel state's
sequence number fields in a way that made no sense and didn't match
the rest of the program, *and* it misinvoked the file opening API. I
must have never had an occasion to test it.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10037 cda61777-01e9-0310-a592-d414129be87e
Pass an error message through to sshfwd_unclean_close.

We have access to one at every call site, so there's really no reason
not to send it through to ssh.c to be logged.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10038 cda61777-01e9-0310-a592-d414129be87e
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: svn://svn.tartarus.org/sgt/putty@10039 cda61777-01e9-0310-a592-d414129be87e