mirror of https://github.com/v2ray/v2ray-core
release buffer after using
parent
bcffdf0da5
commit
578ede2538
|
@ -137,6 +137,7 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
|
|||
responseBuffer := alloc.NewSmallBuffer().Clear()
|
||||
response.Write(responseBuffer)
|
||||
_, err = writer.Write(responseBuffer.Value)
|
||||
responseBuffer.Release()
|
||||
if err != nil {
|
||||
log.Error("Socks failed to write response: %v", err)
|
||||
return err
|
||||
|
@ -158,6 +159,7 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
|
|||
responseBuffer := alloc.NewSmallBuffer().Clear()
|
||||
response.Write(responseBuffer)
|
||||
_, err = writer.Write(responseBuffer.Value)
|
||||
responseBuffer.Release()
|
||||
if err != nil {
|
||||
log.Error("Socks failed to write response: %v", err)
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue