diff --git a/stream.go b/stream.go index b12bb24c..eeb585e7 100644 --- a/stream.go +++ b/stream.go @@ -175,6 +175,11 @@ func (s *Stream) SetReadDeadline(deadline time.Time) error { t.Stop() return case <-t.C: + select { + case <-readTimeoutCancel: + return + default: + } s.lock.Lock() if s.readErr == nil { s.readErr = ErrReadDeadlineExceeded