chore: improve logging and x11 handler call (#18422)

* use `ctx` instead of `session.Context()` for consistency
* log SSH connection start with the phrase `ssh connection` for symmetry
with the stop log and ease of `grep`'ing.
This commit is contained in:
Spike Curtis
2025-06-18 21:21:06 +04:00
committed by GitHub
parent 8f6a5afa4f
commit 1357a3a273
+2 -2
View File
@@ -454,7 +454,7 @@ func (s *Server) sessionHandler(session ssh.Session) {
x11, hasX11 := session.X11()
if hasX11 {
display, handled := s.x11Handler(session.Context(), x11)
display, handled := s.x11Handler(ctx, x11)
if !handled {
logger.Error(ctx, "x11 handler failed")
closeCause("x11 handler failed")
@@ -973,7 +973,7 @@ func (s *Server) handleConn(l net.Listener, c net.Conn) {
return
}
defer s.trackConn(l, c, false)
logger.Info(context.Background(), "started serving connection")
logger.Info(context.Background(), "started serving ssh connection")
// note: srv.ConnectionCompleteCallback logs completion of the connection
s.srv.HandleConn(c)
}