]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Stop Windows PuTTY becoming unresponsive if server floods us.
authorSimon Tatham <anakin@pobox.com>
Sat, 7 Mar 2015 17:10:36 +0000 (17:10 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 20 Jun 2015 08:31:54 +0000 (09:31 +0100)
commit0db409bc07e123f62b43b1e77a516d82a6cc1cd6
tree500711d1b780cbebbecdfba033f93f13efe2becc
parent74f50c9f21b27b789b3e9a0d11eb5ea8d8719e19
Stop Windows PuTTY becoming unresponsive if server floods us.

This was an old bug, fixed around 0.59, which apparently regressed
when I rewrote the main event loop using the toplevel_callback
mechanism.

Investigation just now suggests that it has to do with my faulty
assumption that Windows PeekMessage would deliver messages in its
message queue in FIFO order (i.e. that the thing calling itself a
message queue is actually a _queue_). In fact my WM_NETEVENT seems to
like to jump the queue, so that once a steady stream of them starts
arriving, we never do anything else in the main event loop (except
deal with handles).

Worked around in a simple and slightly bodgy way, namely, we don't
stop looping on PeekMessage and run our toplevel callbacks until we've
either run out of messages completely or else seen at least one that
_isn't_ a WM_NETEVENT. That way we should reliably interleave NETEVENT
processing with processing of other stuff.

(cherry picked from commit 7d97c2a8fdb745905fd61a9ce4abbf822e167cef)
windows/window.c