mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
New Seat method, notify_remote_disconnect.
This notifies the Seat that the entire backend session has finished and closed its network connection - or rather, that it _might_ have done, and that the frontend should check backend_connected() if it wasn't planning to do so already. The existing Seat implementations haven't needed this: the GUI ones don't actually need to do anything specific when the network connection goes away, and the CLI ones deal with it by being in charge of their own event loop so that they can easily check backend_connected() at every possible opportunity in any case. But I'm about to introduce a new Seat implementation that does need to know this, and doesn't have any other way to get notified of it.
This commit is contained in:
@ -109,6 +109,7 @@ static const SeatVtable server_seat_vt = {
|
||||
.eof = nullseat_eof,
|
||||
.get_userpass_input = nullseat_get_userpass_input,
|
||||
.notify_remote_exit = nullseat_notify_remote_exit,
|
||||
.notify_remote_disconnect = nullseat_notify_remote_disconnect,
|
||||
.connection_fatal = nullseat_connection_fatal,
|
||||
.update_specials_menu = nullseat_update_specials_menu,
|
||||
.get_ttymode = nullseat_get_ttymode,
|
||||
|
@ -188,6 +188,7 @@ static const SeatVtable sesschan_seat_vt = {
|
||||
.eof = sesschan_seat_eof,
|
||||
.get_userpass_input = nullseat_get_userpass_input,
|
||||
.notify_remote_exit = sesschan_notify_remote_exit,
|
||||
.notify_remote_disconnect = nullseat_notify_remote_disconnect,
|
||||
.connection_fatal = sesschan_connection_fatal,
|
||||
.update_specials_menu = nullseat_update_specials_menu,
|
||||
.get_ttymode = nullseat_get_ttymode,
|
||||
|
@ -387,6 +387,7 @@ static void ssh_bpp_output_raw_data_callback(void *vctx)
|
||||
if (ssh->pending_close) {
|
||||
sk_close(ssh->s);
|
||||
ssh->s = NULL;
|
||||
seat_notify_remote_disconnect(ssh->seat);
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,6 +429,7 @@ static void ssh_shutdown(Ssh *ssh)
|
||||
if (ssh->s) {
|
||||
sk_close(ssh->s);
|
||||
ssh->s = NULL;
|
||||
seat_notify_remote_disconnect(ssh->seat);
|
||||
}
|
||||
|
||||
bufchain_clear(&ssh->in_raw);
|
||||
@ -788,6 +790,7 @@ static char *connect_to_host(
|
||||
if ((err = sk_socket_error(ssh->s)) != NULL) {
|
||||
ssh->s = NULL;
|
||||
seat_notify_remote_exit(ssh->seat);
|
||||
seat_notify_remote_disconnect(ssh->seat);
|
||||
return dupstr(err);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user