mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 12:57:38 +03:00
Add lazy headroom
This commit is contained in:
parent
c4e9bf11fa
commit
ec72b91c12
2 changed files with 51 additions and 18 deletions
|
@ -88,10 +88,7 @@ type NetVectorisedWriterWrapper struct {
|
|||
|
||||
func (w *NetVectorisedWriterWrapper) WriteVectorised(buffers []*buf.Buffer) error {
|
||||
defer buf.ReleaseMulti(buffers)
|
||||
netBuffers := make(net.Buffers, 0, len(buffers))
|
||||
for _, buffer := range buffers {
|
||||
netBuffers = append(netBuffers, buffer.Bytes())
|
||||
}
|
||||
netBuffers := net.Buffers(buf.ToSliceMulti(buffers))
|
||||
return common.Error(netBuffers.WriteTo(w.upstream))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue