add new locks added to master

This commit is contained in:
Wade Simmons
2025-04-02 11:57:02 -04:00
parent f896e2a863
commit 2a2b6424ed
9 changed files with 31 additions and 20 deletions

View File

@@ -5,10 +5,10 @@ import (
"errors"
"fmt"
"net"
"sync"
"github.com/armon/go-radix"
"github.com/sirupsen/logrus"
"github.com/wadey/synctrace"
"golang.org/x/crypto/ssh"
)
@@ -28,7 +28,7 @@ type SSHServer struct {
listener net.Listener
// Locks the conns/counter to avoid concurrent map access
connsLock sync.Mutex
connsLock synctrace.Mutex
conns map[int]*session
counter int
}
@@ -41,6 +41,7 @@ func NewSSHServer(l *logrus.Entry) (*SSHServer, error) {
l: l,
commands: radix.New(),
conns: make(map[int]*session),
connsLock: synctrace.NewMutex("ssh-server-conns"),
}
cc := ssh.CertChecker{