mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-26 11:44:22 -04:00
Merge branch 'master' of https://github.com/v2ray/v2ray-core
This commit is contained in:
commit
8ce6e741f1
@ -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…
x
Reference in New Issue
Block a user