From 354ef3c27d2ff202e7cdad083804479c5bb9efcb Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 29 Jul 2018 03:13:29 +0200 Subject: [PATCH] fix multibuffer copy --- transport/internet/kcp/connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index 033698dc..1987b1ea 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -398,8 +398,10 @@ func (c *Connection) WriteMultiBuffer(mb buf.MultiBuffer) error { return io.ErrClosedPipe } + mbPtr := &mb + if !c.sendingWorker.Push(func(bb []byte) (int, error) { - return mb.Read(bb[:c.mss]) + return mbPtr.Read(bb[:c.mss]) }) { break }