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
|
@ -122,6 +122,8 @@ func (s *Server) handleSession(shell string, newChannel ssh.NewChannel) {
|
|||
}
|
||||
case "subsystem":
|
||||
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)
|
||||
break
|
||||
}
|
||||
go func() {
|
||||
s.handleTcpipForward(sshConn, req)
|
||||
}()
|
||||
case "streamlocal-forward@openssh.com":
|
||||
if !s.AllowStreamlocalForward {
|
||||
s.Logger.Info("streamlocal-forward not allowed")
|
||||
req.Reply(false, nil)
|
||||
break
|
||||
}
|
||||
go func() {
|
||||
s.handleStreamlocalForward(sshConn, req)
|
||||
}()
|
||||
// TODO: support cancel-tcpip-forward
|
||||
// TODO: support cancel-streamlocal-forward@openssh.com
|
||||
default:
|
||||
// discard
|
||||
if req.WantReply {
|
||||
|
|
Loading…
Add table
Reference in a new issue