pull/432/head
Darien Raymond 8 years ago
commit 8ce6e741f1
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -88,6 +88,10 @@ func (v *Stream) ReadTimeout(timeout time.Duration) (*buf.Buffer, error) {
case b := <-v.buffer: case b := <-v.buffer:
return b, nil return b, nil
default: default:
if timeout == 0 {
return nil, ErrReadTimeout
}
select { select {
case <-v.ctx.Done(): case <-v.ctx.Done():
return nil, io.ErrClosedPipe return nil, io.ErrClosedPipe

Loading…
Cancel
Save