From 46dbbfff8c9b0d3d549fc3a182c400ab35205d45 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 27 May 2018 13:23:41 +0200 Subject: [PATCH] fix reading in udp conn --- app/proxyman/inbound/worker.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index c3f72b00..efce76a7 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -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 }