From cf91937bd6f44fa767ff8bd218884b4fb4f37261 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Mon, 8 Apr 2019 23:36:12 +0100 Subject: [PATCH] Fix double "Network error" message on SSH/Windows. On Windows, PuTTY using the SSH backend could emit messages like "Network error: Network error: Software caused connection abort". When ssh.c regained the ability to emit plug_closing error messages in ed0104c2fe (after it disappeared in fe6caf563c), it came with an extra "Network error:". But winnet.c already adds that prefix. This changes it back the way it was, which is also consistent with the other backends. --- ssh.c | 2 +- sshserver.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh.c b/ssh.c index 3ac5534f..7e9ccd2b 100644 --- a/ssh.c +++ b/ssh.c @@ -580,7 +580,7 @@ static void ssh_closing(Plug *plug, const char *error_msg, int error_code, { Ssh *ssh = container_of(plug, Ssh, plug); if (error_msg) { - ssh_remote_error(ssh, "Network error: %s", error_msg); + ssh_remote_error(ssh, "%s", error_msg); } else if (ssh->bpp) { ssh->bpp->input_eof = true; queue_idempotent_callback(&ssh->bpp->ic_in_raw); diff --git a/sshserver.c b/sshserver.c index f1f6bc08..7ed2052c 100644 --- a/sshserver.c +++ b/sshserver.c @@ -133,7 +133,7 @@ static void server_closing(Plug *plug, const char *error_msg, int error_code, { server *srv = container_of(plug, server, plug); if (error_msg) { - ssh_remote_error(&srv->ssh, "Network error: %s", error_msg); + ssh_remote_error(&srv->ssh, "%s", error_msg); } else if (srv->bpp) { srv->bpp->input_eof = true; queue_idempotent_callback(&srv->bpp->ic_in_raw);