fix reading in udp conn

pull/1132/head
Darien Raymond 7 years ago
parent 13f3c356ca
commit 46dbbfff8c
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -128,20 +128,23 @@ func (c *udpConn) updateActivity() {
func (c *udpConn) ReadMultiBuffer() (buf.MultiBuffer, error) {
var payload buf.MultiBuffer
select {
case in := <-c.input:
payload.Append(in)
default:
select {
case in := <-c.input:
payload.Append(in)
case <-c.done.Wait():
return nil, io.EOF
}
}
L:
for {
select {
case in := <-c.input:
payload.Append(in)
case <-c.done.Wait():
break L
default:
break L
}

Loading…
Cancel
Save