use compact in tls writer

pull/1869/head^2
Darien Raymond 6 years ago
parent c72d853454
commit 41b1ac192e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -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 {

Loading…
Cancel
Save