diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index f21ea5f9..bc9d7059 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -15,18 +15,13 @@ var ( type conn struct { *tls.Conn - - mergingWriter *buf.BufferedWriter } func (c *conn) WriteMultiBuffer(mb buf.MultiBuffer) error { - if c.mergingWriter == nil { - c.mergingWriter = buf.NewBufferedWriter(buf.NewWriter(c.Conn)) - } - if err := c.mergingWriter.WriteMultiBuffer(mb); err != nil { - return err - } - return c.mergingWriter.Flush() + mb = buf.Compact(mb) + mb, err := buf.WriteMultiBuffer(c, mb) + buf.ReleaseMulti(mb) + return err } func (c *conn) HandshakeAddress() net.Address {