mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
use compact in tls writer
This commit is contained in:
parent
c72d853454
commit
41b1ac192e
@ -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…
Reference in New Issue
Block a user