MCPcopy
hub / github.com/gliderlabs/ssh / trackConn

Method trackConn

server.go:448–462  ·  view source on GitHub ↗
(c *gossh.ServerConn, add bool)

Source from the content-addressed store, hash-verified

446}
447
448func (srv *Server) trackConn(c *gossh.ServerConn, add bool) {
449 srv.mu.Lock()
450 defer srv.mu.Unlock()
451
452 if srv.conns == nil {
453 srv.conns = make(map[*gossh.ServerConn]struct{})
454 }
455 if add {
456 srv.conns[c] = struct{}{}
457 srv.connWg.Add(1)
458 } else {
459 delete(srv.conns, c)
460 srv.connWg.Done()
461 }
462}

Callers 1

HandleConnMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected