update WriteMultiBuffer

pull/1435/head
Darien Raymond 2018-11-22 13:36:36 +01:00
parent 3a1cf06dc1
commit fa7ce36aa8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 4 deletions

View File

@ -9,7 +9,6 @@ import (
quic "github.com/lucas-clemente/quic-go"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/bytespool"
"v2ray.com/core/common/net"
"v2ray.com/core/transport/internet"
)
@ -154,8 +153,8 @@ func (c *interConn) WriteMultiBuffer(mb buf.MultiBuffer) error {
return err
}
b := bytespool.Alloc(32 * 1024)
defer bytespool.Free(b)
b := getBuffer()
defer putBuffer(b)
reader := buf.MultiBufferContainer{
MultiBuffer: mb,
@ -163,7 +162,7 @@ func (c *interConn) WriteMultiBuffer(mb buf.MultiBuffer) error {
defer reader.Close()
for {
nBytes, err := reader.Read(b)
nBytes, err := reader.Read(b[:1380])
if err != nil {
break
}