From d4253d7a55f7af862304fb65c461547055dd294a Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 17 Nov 2019 21:42:41 +0100 Subject: Update shazow/ssh-chat dependency (#947) --- vendor/github.com/shazow/ssh-chat/sshd/net.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/shazow/ssh-chat/sshd/net.go') diff --git a/vendor/github.com/shazow/ssh-chat/sshd/net.go b/vendor/github.com/shazow/ssh-chat/sshd/net.go index 1b3f4028..8305696b 100644 --- a/vendor/github.com/shazow/ssh-chat/sshd/net.go +++ b/vendor/github.com/shazow/ssh-chat/sshd/net.go @@ -7,7 +7,7 @@ import ( "golang.org/x/crypto/ssh" ) -// Container for the connection and ssh-related configuration +// SSHListener is the container for the connection and ssh-related configuration type SSHListener struct { net.Listener config *ssh.ServerConfig @@ -16,7 +16,7 @@ type SSHListener struct { HandlerFunc func(term *Terminal) } -// Make an SSH listener socket +// ListenSSH makes an SSH listener socket func ListenSSH(laddr string, config *ssh.ServerConfig) (*SSHListener, error) { socket, err := net.Listen("tcp", laddr) if err != nil { @@ -43,7 +43,7 @@ func (l *SSHListener) handleConn(conn net.Conn) (*Terminal, error) { return NewSession(sshConn, channels) } -// Accept incoming connections as terminal requests and yield them +// Serve Accepts incoming connections as terminal requests and yield them func (l *SSHListener) Serve() { defer l.Close() for { @@ -59,6 +59,7 @@ func (l *SSHListener) Serve() { term, err := l.handleConn(conn) if err != nil { logger.Printf("[%s] Failed to handshake: %s", conn.RemoteAddr(), err) + conn.Close() // Must be closed to avoid a leak return } l.HandlerFunc(term) -- cgit v1.2.3