1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 19:42:48 -05:00

New plug_closing error type for 'user abort'.

This is generated when setup of a network connection is cancelled by
deliberate user action, namely, pressing ^C or ^D or the like at a
get_userpass_input prompt presented during proxy setup.

It's handled just like normal socket setup errors, except that it
omits the call to seat_connection_fatal, on the grounds that in this
one case of connection-setup failure, the user doesn't need to be
_informed_ that the connection failed - they already know, because
they failed it themself on purpose.
This commit is contained in:
Simon Tatham
2021-11-06 13:31:09 +00:00
parent 0fe41294e6
commit 2ae338b407
7 changed files with 26 additions and 17 deletions

View File

@ -606,7 +606,9 @@ static void ssh_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
static void ssh_closing(Plug *plug, PlugCloseType type, const char *error_msg)
{
Ssh *ssh = container_of(plug, Ssh, plug);
if (type != PLUGCLOSE_NORMAL) {
if (type == PLUGCLOSE_USER_ABORT) {
ssh_user_close(ssh, "%s", error_msg);
} else if (type != PLUGCLOSE_NORMAL) {
ssh_remote_error(ssh, "%s", error_msg);
} else if (ssh->bpp) {
ssh->bpp->input_eof = true;