From 18f3fb5196f9f0c8384fcbbfbd86c5b68007cc4f Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 29 Jul 2018 10:47:50 +0200 Subject: [PATCH] comment --- transport/internet/kcp/connection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index 4cf827362..4b7d92dc2 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -343,6 +343,9 @@ func (c *Connection) waitForDataOutput() error { // Write implements io.Writer. func (c *Connection) Write(b []byte) (int, error) { + // This involves multiple copies of the buffer. But we don't expect this method to be used often. + // Only wrapped connections such as TLS and WebSocket will call into this. + // TODO: improve effeciency. var mb buf.MultiBuffer common.Must2(mb.Write(b)) if err := c.WriteMultiBuffer(mb); err != nil {