mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-31 18:54:07 -05:00
Major destabilisation, phase 2. This time it's the backends' turn:
each backend now stores all its internal variables in a big struct, and each backend function gets a pointer to this struct passed to it. This still isn't the end of the work - lots of subsidiary things still use globals, notably all the cipher and compressor modules and the X11 forwarding authentication stuff. But ssh.c itself has now been transformed, and that was the really painful bit, so from here on it all ought to be a sequence of much smaller and simpler pieces of work. [originally from svn r2127]
This commit is contained in:
35
window.c
35
window.c
@@ -600,7 +600,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
char msg[1024], *title;
|
||||
char *realhost;
|
||||
|
||||
error = back->init((void *)term,
|
||||
error = back->init((void *)term, &backhandle,
|
||||
cfg.host, cfg.port, &realhost, cfg.tcp_nodelay);
|
||||
if (error) {
|
||||
sprintf(msg, "Unable to open connection to\n"
|
||||
@@ -620,6 +620,11 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
set_icon(title);
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect the terminal to the backend for resize purposes.
|
||||
*/
|
||||
term_provide_resize_fn(term, back->size, backhandle);
|
||||
|
||||
session_closed = FALSE;
|
||||
|
||||
/*
|
||||
@@ -1610,7 +1615,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
time_t now;
|
||||
time(&now);
|
||||
if (now - last_movement > cfg.ping_interval) {
|
||||
back->special(TS_PING);
|
||||
back->special(backhandle, TS_PING);
|
||||
last_movement = now;
|
||||
}
|
||||
}
|
||||
@@ -1860,55 +1865,55 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
ldisc_send(NULL, 0, 0);
|
||||
break;
|
||||
case IDM_TEL_AYT:
|
||||
back->special(TS_AYT);
|
||||
back->special(backhandle, TS_AYT);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_BRK:
|
||||
back->special(TS_BRK);
|
||||
back->special(backhandle, TS_BRK);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_SYNCH:
|
||||
back->special(TS_SYNCH);
|
||||
back->special(backhandle, TS_SYNCH);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_EC:
|
||||
back->special(TS_EC);
|
||||
back->special(backhandle, TS_EC);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_EL:
|
||||
back->special(TS_EL);
|
||||
back->special(backhandle, TS_EL);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_GA:
|
||||
back->special(TS_GA);
|
||||
back->special(backhandle, TS_GA);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_NOP:
|
||||
back->special(TS_NOP);
|
||||
back->special(backhandle, TS_NOP);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_ABORT:
|
||||
back->special(TS_ABORT);
|
||||
back->special(backhandle, TS_ABORT);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_AO:
|
||||
back->special(TS_AO);
|
||||
back->special(backhandle, TS_AO);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_IP:
|
||||
back->special(TS_IP);
|
||||
back->special(backhandle, TS_IP);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_SUSP:
|
||||
back->special(TS_SUSP);
|
||||
back->special(backhandle, TS_SUSP);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_EOR:
|
||||
back->special(TS_EOR);
|
||||
back->special(backhandle, TS_EOR);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_TEL_EOF:
|
||||
back->special(TS_EOF);
|
||||
back->special(backhandle, TS_EOF);
|
||||
net_pending_errors();
|
||||
break;
|
||||
case IDM_ABOUT:
|
||||
|
Reference in New Issue
Block a user