aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Latta <zach@zachlatta.com>2016-03-06 08:59:50 -0500
committerZach Latta <zach@zachlatta.com>2016-03-06 08:59:50 -0500
commit3d05e6211427612a4187c4f34cecb65ceb895016 (patch)
treeffca1e54ce97e98f8415a80db58aec51a8a2740f
parenta0785fa10836234779818e75719938efe34cfa32 (diff)
downloadsshtron-3d05e6211427612a4187c4f34cecb65ceb895016.tar.gz
Fix handshake crashes
-rw-r--r--main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go
index 27c4abe..26e1063 100644
--- a/main.go
+++ b/main.go
@@ -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
Un proyecto texto-plano.xyz