mirror of
https://github.com/nwtgck/handy-sshd.git
synced 2025-07-27 00:07:18 +00:00
fix: handle multiple global requests simultaneously
This commit is contained in:
parent
5cc6ad44c6
commit
b1973ce4e8
1 changed files with 10 additions and 2 deletions
12
server.go
12
server.go
|
@ -122,6 +122,8 @@ func (s *Server) handleSession(shell string, newChannel ssh.NewChannel) {
|
||||||
}
|
}
|
||||||
case "subsystem":
|
case "subsystem":
|
||||||
s.handleSessionSubSystem(req, connection)
|
s.handleSessionSubSystem(req, connection)
|
||||||
|
default:
|
||||||
|
s.Logger.Info("unknown request", "req_type", req.Type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,14 +314,20 @@ func (s *Server) HandleGlobalRequests(sshConn *ssh.ServerConn, reqs <-chan *ssh.
|
||||||
req.Reply(false, nil)
|
req.Reply(false, nil)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
s.handleTcpipForward(sshConn, req)
|
go func() {
|
||||||
|
s.handleTcpipForward(sshConn, req)
|
||||||
|
}()
|
||||||
case "streamlocal-forward@openssh.com":
|
case "streamlocal-forward@openssh.com":
|
||||||
if !s.AllowStreamlocalForward {
|
if !s.AllowStreamlocalForward {
|
||||||
s.Logger.Info("streamlocal-forward not allowed")
|
s.Logger.Info("streamlocal-forward not allowed")
|
||||||
req.Reply(false, nil)
|
req.Reply(false, nil)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
s.handleStreamlocalForward(sshConn, req)
|
go func() {
|
||||||
|
s.handleStreamlocalForward(sshConn, req)
|
||||||
|
}()
|
||||||
|
// TODO: support cancel-tcpip-forward
|
||||||
|
// TODO: support cancel-streamlocal-forward@openssh.com
|
||||||
default:
|
default:
|
||||||
// discard
|
// discard
|
||||||
if req.WantReply {
|
if req.WantReply {
|
||||||
|
|
Loading…
Add table
Reference in a new issue