tun2: catch panics

This commit is contained in:
Cadey Ratio 2017-09-30 10:42:09 -07:00
parent 941f1042e9
commit 235eed3d84
No known key found for this signature in database
GPG Key ID: D607EE27C2E7F89A
1 changed files with 6 additions and 0 deletions

View File

@ -340,6 +340,12 @@ func (s *Server) HandleConn(c net.Conn, isKCP bool) {
Auth: auth,
}
defer func() {
if r := recover(); r != nil {
ln.Log(connection, ln.F{"action": "connection handler panic", "err": r})
}
}()
ln.Log(ln.F{
"action": "backend_connected",
}, connection.F())