From d4c297e9ca49f92c9a99c2670eb1c7449c04190e Mon Sep 17 00:00:00 2001 From: NI Date: Mon, 12 Aug 2019 12:19:30 +0800 Subject: [PATCH] Remote connection failure should not effect host connection (Returning error will trigger the termination of the host connection) --- application/commands/ssh.go | 4 +++- application/commands/telnet.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/commands/ssh.go b/application/commands/ssh.go index 949e466..e65608b 100644 --- a/application/commands/ssh.go +++ b/application/commands/ssh.go @@ -524,8 +524,10 @@ func (d *sshClient) local( _, wErr := remote.writer.Write(rData) if wErr != nil { - return wErr + d.l.Debug("Failed to write data to remote: %s", wErr) } + + return nil } return nil diff --git a/application/commands/telnet.go b/application/commands/telnet.go index f4c9b01..3e1d3cc 100644 --- a/application/commands/telnet.go +++ b/application/commands/telnet.go @@ -180,8 +180,10 @@ func (d *telnetClient) client( _, wErr := remoteConn.Write(rBuf) if wErr != nil { - return wErr + d.l.Debug("Failed to write data to remote: %s", wErr) } + + return nil } return nil