Skip to content

Commit

Permalink
buffer: handle cancel timeout explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
thda committed Sep 27, 2019
1 parent 49af1c6 commit cf9b6a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ func (b *buf) processCancel() (err error) {
// this will effectively block until cancel packet is sent
select {
case cancelErr = <-b.cancelCh:
case <-time.After(time.Duration(b.CancelTimeout) * time.Second):
return fmt.Errorf("netlib: timeout while processing cancel")
}

// read until last packet
Expand Down

0 comments on commit cf9b6a0

Please sign in to comment.