mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
New abstraction 'Seat', to pass to backends.
This is a new vtable-based abstraction which is passed to a backend in place of Frontend, and it implements only the subset of the Frontend functions needed by a backend. (Many other Frontend functions still exist, notably the wide range of things called by terminal.c providing platform-independent operations on the GUI terminal window.) The purpose of making it a vtable is that this opens up the possibility of creating a backend as an internal implementation detail of some other activity, by providing just that one backend with a custom Seat that implements the methods differently. For example, this refactoring should make it feasible to directly implement an SSH proxy type, aka the 'jump host' feature supported by OpenSSH, aka 'open a secondary SSH session in MAINCHAN_DIRECT_TCP mode, and then expose the main channel of that as the Socket for the primary connection'. (Which of course you can already do by spawning 'plink -nc' as a separate proxy process, but this would permit it in the _same_ process without anything getting confused.) I've centralised a full set of stub methods in misc.c for the new abstraction, which allows me to get rid of several annoying stubs in the previous code. Also, while I'm here, I've moved a lot of duplicated modalfatalbox() type functions from application main program files into wincons.c / uxcons.c, which I think saves duplication overall. (A minor visible effect is that the prefixes on those console-based fatal error messages will now be more consistent between applications.)
This commit is contained in:
@ -237,11 +237,25 @@ void quit_help(HWND hwnd);
|
||||
/*
|
||||
* The terminal and logging context are notionally local to the
|
||||
* Windows front end, but they must be shared between window.c and
|
||||
* windlg.c. Likewise the saved-sessions list.
|
||||
* windlg.c. Likewise the Seat structure for the Windows GUI.
|
||||
*/
|
||||
GLOBAL Terminal *term;
|
||||
GLOBAL LogContext *logctx;
|
||||
|
||||
/*
|
||||
* GUI seat methods in windlg.c.
|
||||
*/
|
||||
int win_seat_verify_ssh_host_key(
|
||||
Seat *seat, const char *host, int port,
|
||||
const char *keytype, char *keystr, char *key_fingerprint,
|
||||
void (*callback)(void *ctx, int result), void *ctx);
|
||||
int win_seat_confirm_weak_crypto_primitive(
|
||||
Seat *seat, const char *algtype, const char *algname,
|
||||
void (*callback)(void *ctx, int result), void *ctx);
|
||||
int win_seat_confirm_weak_cached_hostkey(
|
||||
Seat *seat, const char *algname, const char *betteralgs,
|
||||
void (*callback)(void *ctx, int result), void *ctx);
|
||||
|
||||
/*
|
||||
* Windows-specific clipboard helper function shared with windlg.c,
|
||||
* which takes the data string in the system code page instead of
|
||||
|
Reference in New Issue
Block a user