mirror of https://github.com/v2ray/v2ray-core
Merge branch 'master' of https://github.com/v2ray/v2ray-core
commit
8ce6e741f1
|
@ -88,6 +88,10 @@ func (v *Stream) ReadTimeout(timeout time.Duration) (*buf.Buffer, error) {
|
|||
case b := <-v.buffer:
|
||||
return b, nil
|
||||
default:
|
||||
if timeout == 0 {
|
||||
return nil, ErrReadTimeout
|
||||
}
|
||||
|
||||
select {
|
||||
case <-v.ctx.Done():
|
||||
return nil, io.ErrClosedPipe
|
||||
|
|
Loading…
Reference in New Issue