Fix panic with missing request handler

Fixes #102
This commit is contained in:
Kaleb Elwert 2019-04-24 23:59:02 -07:00
parent 9253a53eda
commit a9daacccc9

@ -267,8 +267,10 @@ func (srv *Server) handleConn(newConn net.Conn) {
func (srv *Server) handleRequests(ctx Context, in <-chan *gossh.Request) { func (srv *Server) handleRequests(ctx Context, in <-chan *gossh.Request) {
for req := range in { for req := range in {
handler, found := srv.requestHandlers[req.Type] handler, found := srv.requestHandlers[req.Type]
if !found && req.WantReply { if !found {
if req.WantReply {
req.Reply(false, nil) req.Reply(false, nil)
}
continue continue
} }
/*reqCtx, cancel := context.WithCancel(ctx) /*reqCtx, cancel := context.WithCancel(ctx)