From 6fea2226e1f2de1b18e75228a4fbe34616796d01 Mon Sep 17 00:00:00 2001 From: duanhf2012 <6549168@qq.com> Date: Fri, 21 Jul 2023 17:03:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=8F=E8=AE=AE=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network/processor/pbprocessor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network/processor/pbprocessor.go b/network/processor/pbprocessor.go index fc2ff76..6e9c44d 100644 --- a/network/processor/pbprocessor.go +++ b/network/processor/pbprocessor.go @@ -68,6 +68,11 @@ func (pbProcessor *PBProcessor) MsgRoute(clientId uint64, msg interface{}) error // must goroutine safe func (pbProcessor *PBProcessor) Unmarshal(clientId uint64, data []byte) (interface{}, error) { defer pbProcessor.ReleaseByteSlice(data) + return pbProcessor.UnmarshalWithOutRelease(clientId, data) +} + +// unmarshal but not release data +func (pbProcessor *PBProcessor) UnmarshalWithOutRelease(clientId uint64, data []byte) (interface{}, error) { var msgType uint16 if pbProcessor.LittleEndian == true { msgType = binary.LittleEndian.Uint16(data[:2])