mirror of https://github.com/v2ray/v2ray-core
fix reading in udp conn
parent
13f3c356ca
commit
46dbbfff8c
|
@ -131,8 +131,13 @@ func (c *udpConn) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
|||
select {
|
||||
case in := <-c.input:
|
||||
payload.Append(in)
|
||||
case <-c.done.Wait():
|
||||
return nil, io.EOF
|
||||
default:
|
||||
select {
|
||||
case in := <-c.input:
|
||||
payload.Append(in)
|
||||
case <-c.done.Wait():
|
||||
return nil, io.EOF
|
||||
}
|
||||
}
|
||||
|
||||
L:
|
||||
|
@ -140,8 +145,6 @@ L:
|
|||
select {
|
||||
case in := <-c.input:
|
||||
payload.Append(in)
|
||||
case <-c.done.Wait():
|
||||
break L
|
||||
default:
|
||||
break L
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue