1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-01 23:15:21 -05:00

release buffer

This commit is contained in:
Darien Raymond
2017-04-15 22:29:38 +02:00
parent abe790181e
commit 02ce3ffded
2 changed files with 4 additions and 0 deletions

View File

@@ -245,6 +245,8 @@ func (w *AuthenticationWriter) Write(b []byte) (int, error) {
}
func (w *AuthenticationWriter) WriteMultiBuffer(mb buf.MultiBuffer) (int, error) {
defer mb.Release()
const StartIndex = 17 * 1024
var totalBytes int
for {

View File

@@ -385,6 +385,8 @@ type UDPWriter struct {
}
func (w *UDPWriter) Write(mb buf.MultiBuffer) error {
defer mb.Release()
for _, b := range mb {
if err := w.writeInternal(b); err != nil {
return err