From 37301efe606906e390d91c5938aa8dc9dfc8be7e Mon Sep 17 00:00:00 2001 From: Kevin Wallace Date: Sat, 25 Apr 2026 06:13:06 -0700 Subject: wait for cvend at startup, only redraw on state changes --- ipp/ipp.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ipp') diff --git a/ipp/ipp.go b/ipp/ipp.go index 391b094..89036b0 100644 --- a/ipp/ipp.go +++ b/ipp/ipp.go @@ -149,11 +149,11 @@ func (s *session) handleMsg(bs []byte) (nRead int) { return } } - var ellipsis string - if ippLen > 0 { - ellipsis = "..." - } if *Trace { + var ellipsis string + if ippLen > 0 { + ellipsis = "..." + } log.Printf("%s < %s%s%s", s.path, hex.EncodeToString(bs[:7]), ellipsis, hex.EncodeToString(bs[7+ippLen:expectedLen])) } if s.handler != nil { @@ -166,7 +166,9 @@ func (s *session) Close() error { s.mu.Lock() defer s.mu.Unlock() s.closed = true - return unix.Close(s.fd) + fd := s.fd + s.fd = -1 + return unix.Close(fd) } func (s *session) Write(bs []byte) (int, error) { -- cgit v1.2.3