From 53100eb6c8d14da527550755135d0b5b5e1d80a7 Mon Sep 17 00:00:00 2001 From: rouggy Date: Sun, 30 Aug 2026 15:55:58 +0200 Subject: [PATCH] debug(rigctld): always trace a client's first six commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A connect that lasts 50 ms leaves nothing to say which answer the client disliked — WSJT-X refusing to attach to the shared CAT was undiagnosable without the full wire trace. The handshake is now always logged; steady-state polling stays behind the trace switch. --- internal/rigctld/rigctld.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/rigctld/rigctld.go b/internal/rigctld/rigctld.go index 0186755..c51a1ca 100644 --- a/internal/rigctld/rigctld.go +++ b/internal/rigctld/rigctld.go @@ -246,6 +246,11 @@ func (s *Server) serve(c net.Conn) { s.releasePTT(fmt.Sprintf("client %s left", c.RemoteAddr())) }() s.log("rigctld: client connected from %s", c.RemoteAddr()) + // The HANDSHAKE is always traced — the first few commands are where a + // client decides to stay or hang up, and a connect that lasted 50 ms left + // nothing in the log to say which answer it disliked. Steady-state polling + // stays behind the CAT trace switch. + traced := 0 r := bufio.NewReader(c) w := bufio.NewWriter(c) for { @@ -265,7 +270,8 @@ func (s *Server) serve(c net.Conn) { // that preceded it — the one thing needed to tell whether OpsLog answered // something the client could not accept. Behind the same switch as the CAT // wire trace: this is one line per poll and would drown an ordinary log. - if req != "" && cat.CIVTraceEnabled() { + if req != "" && (traced < 6 || cat.CIVTraceEnabled()) { + traced++ s.log("rigctld: %s → %q ⇒ %q", c.RemoteAddr(), req, strings.TrimRight(resp, "\r\n")) } if resp != "" {