1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-12 18:13:50 -05:00
Simon Tatham 3d44cef8ea winsftp.c: avoid creating multiple netevents.
The do_select function is called with a boolean parameter indicating
whether we're supposed to start or stop paying attention to network
activity on a given socket. So if we freeze and unfreeze the socket in
mid-session because of backlog, we'll call do_select(s, false) to
freeze it, and do_select(s, true) to unfreeze it.

But the implementation of do_select in the Windows SFTP code predated
the rigorous handling of socket backlogs, so it assumed that
do_select(s, true) would only be called at initialisation time, i.e.
only once, and therefore that it was safe to use that flag as a cue to
set up the Windows event object to associate with socket activity.
Hence, every time the socket was frozen and unfrozen, we would create
a new netevent at unfreeze time, leaking the old one.

I think perhaps part of the reason why that was hard to figure out was
that the boolean parameter was called 'startup' rather than 'enable'.
To make it less confusing the next time I read this code, I've also
renamed it, and while I was at it, adjusted another related comment.

(cherry picked from commit bd5c957e5bd0f850ab30c6b1ab94bfbbabe9f006)
2020-02-09 08:19:21 +00:00
..
2019-03-18 20:32:55 +00:00
2019-03-18 20:32:55 +00:00
2017-09-13 19:26:28 +01:00
2017-05-07 16:29:01 +01:00
2019-03-18 20:32:55 +00:00
2019-10-14 19:42:37 +01:00
2019-10-14 19:42:37 +01:00
2019-10-14 19:42:37 +01:00
2019-10-14 19:42:37 +01:00
2019-10-14 19:42:37 +01:00