r4906 in the process of adding the new timing code. It seems to have
been what was previously preventing spew-lockup, and still seems to
prevent it now I've put it back in.
git-svn-id: svn://svn.tartarus.org/sgt/putty@7071
cda61777-01e9-0310-a592-
d414129be87e
static int was_zoomed = 0;
static int prev_rows, prev_cols;
static int was_zoomed = 0;
static int prev_rows, prev_cols;
-static void enact_netevent(WPARAM, LPARAM);
+static int pending_netevent = 0;
+static WPARAM pend_netevent_wParam = 0;
+static LPARAM pend_netevent_lParam = 0;
+static void enact_pending_netevent(void);
static void flash_window(int mode);
static void sys_cursor_update(void);
static int is_shift_pressed(void);
static void flash_window(int mode);
static void sys_cursor_update(void);
static int is_shift_pressed(void);
sfree(handles);
if (must_close_session)
close_session();
sfree(handles);
if (must_close_session)
close_session();
/* The messages seem unreliable; especially if we're being tricky */
term_set_focus(term, GetForegroundWindow() == hwnd);
/* The messages seem unreliable; especially if we're being tricky */
term_set_focus(term, GetForegroundWindow() == hwnd);
+ if (pending_netevent)
+ enact_pending_netevent();
+
/*
* Actually do the job requested by a WM_NETEVENT
*/
/*
* Actually do the job requested by a WM_NETEVENT
*/
-static void enact_netevent(WPARAM wParam, LPARAM lParam)
+static void enact_pending_netevent(void)
{
static int reentering = 0;
extern int select_result(WPARAM, LPARAM);
{
static int reentering = 0;
extern int select_result(WPARAM, LPARAM);
if (reentering)
return; /* don't unpend the pending */
if (reentering)
return; /* don't unpend the pending */
+ pending_netevent = FALSE;
+
- select_result(wParam, lParam);
+ select_result(pend_netevent_wParam, pend_netevent_lParam);
}
return 0;
case WM_NETEVENT:
}
return 0;
case WM_NETEVENT:
- enact_netevent(wParam, lParam);
+ /* Notice we can get multiple netevents, FD_READ, FD_WRITE etc
+ * but the only one that's likely to try to overload us is FD_READ.
+ * This means buffering just one is fine.
+ */
+ if (pending_netevent)
+ enact_pending_netevent();
+
+ pending_netevent = TRUE;
+ pend_netevent_wParam = wParam;
+ pend_netevent_lParam = lParam;
+ if (WSAGETSELECTEVENT(lParam) != FD_READ)
+ enact_pending_netevent();
+
net_pending_errors();
return 0;
case WM_SETFOCUS:
net_pending_errors();
return 0;
case WM_SETFOCUS: