Use []byte in pool instead of buffer

This commit is contained in:
V2Ray committed 2015-10-08 17:41:38 +02:00
1 parent 472cf7f523
commit 3cb1951dfc
8 files changed
+38 -44

No files matched your search

+1 -1
View File
@@ -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 {