From ed0104c2feae935271a12af7a9175b81527fe96e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 27 Sep 2018 18:06:16 +0100 Subject: [PATCH] ssh_closing: distinguish socket errors from EOF. I forgot to check the error_msg parameter at all. --- ssh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssh.c b/ssh.c index 20e9bff7..0e01b690 100644 --- a/ssh.c +++ b/ssh.c @@ -507,7 +507,9 @@ static void ssh_closing(Plug plug, const char *error_msg, int error_code, int calling_back) { Ssh ssh = FROMFIELD(plug, struct ssh_tag, plugvt); - if (ssh->bpp) { + if (error_msg) { + ssh_remote_error(ssh, "Network error: %s", error_msg); + } else if (ssh->bpp) { ssh->bpp->input_eof = TRUE; queue_idempotent_callback(&ssh->bpp->ic_in_raw); }