mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-14 06:46:11 +00:00
allow 0 timeout
This commit is contained in:
1 file changed
+4
@@ -91,6 +91,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
|
||||
|
||||
Reference in new issue
Block a user