From 1357a3a2734f625efcc5d6e4dbfcb020ef080d6d Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 18 Jun 2025 21:21:06 +0400 Subject: [PATCH] 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. --- agent/agentssh/agentssh.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agentssh/agentssh.go b/agent/agentssh/agentssh.go index 293dd4db16..a2fec79deb 100644 --- a/agent/agentssh/agentssh.go +++ b/agent/agentssh/agentssh.go @@ -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) }