diff options
Diffstat (limited to 'ipp/ipp.go')
| -rw-r--r-- | ipp/ipp.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) { |