mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-30 23:37:44 +00:00
Use []byte in pool instead of buffer
This commit is contained in:
1 parent
472cf7f523
commit
3cb1951dfc
8 files changed
+38
-44
No files matched your search
@@ -60,6 +60,7 @@ func (handler *VMessInboundHandler) AcceptPackets(conn *net.UDPConn) {
|
||||
nBytes, err = cryptReader.Read(data.Value)
|
||||
if err != nil {
|
||||
log.Warning("VMessIn: Unable to decrypt data: %v", err)
|
||||
data.Release()
|
||||
continue
|
||||
}
|
||||
data.Slice(0, nBytes)
|
||||
@@ -91,7 +92,6 @@ func (handler *VMessInboundHandler) handlePacket(conn *net.UDPConn, request *pro
|
||||
hasData = true
|
||||
responseWriter.Write(data.Value)
|
||||
data.Release()
|
||||
data = nil
|
||||
}
|
||||
|
||||
if hasData {
|
||||
|
||||
Reference in new issue
Block a user