Skip to content

Commit

Permalink
fix: remove noisy logs (#116)
Browse files Browse the repository at this point in the history
We expect to see these logs all the time.

fixes #115
  • Loading branch information
Stebalien authored Feb 6, 2024
1 parent 13916cc commit 7222fbc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,17 +717,13 @@ func (s *Session) handleStreamMessage(hdr header) error {
stream := s.streams[id]
s.streamLock.Unlock()

// If we do not have a stream, likely we sent a RST
// If we do not have a stream, likely we sent a RST and/or closed the stream for reading.
if stream == nil {
// Drain any data on the wire
if hdr.MsgType() == typeData && hdr.Length() > 0 {
s.logger.Printf("[WARN] yamux: Discarding data for stream: %d", id)
if _, err := io.CopyN(io.Discard, s.reader, int64(hdr.Length())); err != nil {
s.logger.Printf("[ERR] yamux: Failed to discard data: %v", err)
return nil
}
} else {
s.logger.Printf("[WARN] yamux: frame for missing stream: %v", hdr)
}
return nil
}
Expand Down

0 comments on commit 7222fbc

Please sign in to comment.