]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix multiple bugs in freeze/thaw of Windows handle-sockets.
authorSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 19:19:38 +0000 (19:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 19:19:38 +0000 (19:19 +0000)
commit2fb3e26584315e1d962226de40686c4cd7530bb7
tree9ccef856ed981a848ccd9e88b81efe59613fb703
parent24c9cfc800c5e81819d80fd3eda953f950e263d6
Fix multiple bugs in freeze/thaw of Windows handle-sockets.

Firstly, I had asserted that data would never arrive on a handle
socket in state FREEZING, which is just an error, because FREEZING is
precisely the state of not being quite frozen _yet_ because one last
read is still expected to arrive from the winhandl.c reading subthread
which it's too late to cancel. I meant to assert that it wasn't
FROZEN.

Secondly, when the handle socket was in state FREEZING, I failed to
actually _set_ it to FROZEN.

And thirdly, when the handle socket starts thawing again (i.e. there's
now outgoing buffer space so we can start sending our backlogged
data), I forgot to ever call bufchain_consume, so that the same block
of data would get sent repeatedly.

I can only assume that nothing I've ever done has actually exercised
this code!
windows/winhsock.c