diff options
author | Zach Latta <zach@zachlatta.com> | 2016-03-06 08:59:50 -0500 |
---|---|---|
committer | Zach Latta <zach@zachlatta.com> | 2016-03-06 08:59:50 -0500 |
commit | 3d05e6211427612a4187c4f34cecb65ceb895016 (patch) | |
tree | ffca1e54ce97e98f8415a80db58aec51a8a2740f | |
parent | a0785fa10836234779818e75719938efe34cfa32 (diff) | |
download | sshtron-3d05e6211427612a4187c4f34cecb65ceb895016.tar.gz |
Fix handshake crashes
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -22,7 +22,8 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) { // net.Conn. _, chans, reqs, err := ssh.NewServerConn(conn, config) if err != nil { - panic("failed to handshake") + fmt.Println("Failed to handshake with new client") + return } // The incoming Request channel must be serviced. go ssh.DiscardRequests(reqs) @@ -39,7 +40,8 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) { } channel, requests, err := newChannel.Accept() if err != nil { - panic("could not accept channel.") + fmt.Println("could not accept channel.") + return } // Reject all out of band requests accept for the unix defaults, pty-req and |