mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-29 07:49:14 +01:00
[client] Bound the SSH session request queue and keep resizes from blocking the session loop (#8363)
* Bound the SSH session request queue by bytes and stop resizes reaching a loop with no consumer * Give the window change drain loop a body * Avoid an empty case clause in the SSH request filter * Charge only the newest resize to the request queue and classify requests before the byte limit
This commit is contained in:
@@ -53,13 +53,20 @@ func (s *Server) sessionHandler(session ssh.Session) {
|
||||
logger.Infof("SSH session closed after %v", duration)
|
||||
}()
|
||||
|
||||
ptyReq, winCh, isPty := session.Pty()
|
||||
if isPty {
|
||||
// The request loop blocks sending a resize nobody reads, and only sees its request
|
||||
// stream close once that send completes. Covers the paths below that return
|
||||
// without consuming window changes.
|
||||
defer drainWindowChanges(winCh)
|
||||
}
|
||||
|
||||
privilegeResult, err := s.userPrivilegeCheck(session.User())
|
||||
if err != nil {
|
||||
s.handlePrivError(logger, session, err)
|
||||
return
|
||||
}
|
||||
|
||||
ptyReq, winCh, isPty := session.Pty()
|
||||
hasCommand := session.RawCommand() != ""
|
||||
|
||||
if isPty && !hasCommand {
|
||||
|
||||
Reference in New Issue
Block a user