Skip to content

Commit

Permalink
Check deadline timer before signaling
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt authored and edaniels committed Feb 28, 2024
1 parent a5583a6 commit 29d0811
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29d0811

Please sign in to comment.