From f6980261d456531f69fd8ab92437539d75dd344d Mon Sep 17 00:00:00 2001 From: lanrenwo Date: Sun, 3 Sep 2023 11:18:52 +0800 Subject: [PATCH] =?UTF-8?q?logAudit=E5=BC=95=E5=85=A5recover,=20=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E4=B8=BB=E7=A8=8B=E5=BA=8F=E5=B4=A9=E6=BA=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/handler/payload_access_audit.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/handler/payload_access_audit.go b/server/handler/payload_access_audit.go index 89f3450..e703c1c 100644 --- a/server/handler/payload_access_audit.go +++ b/server/handler/payload_access_audit.go @@ -3,6 +3,7 @@ package handler import ( "crypto/md5" "encoding/binary" + "runtime/debug" "time" "github.com/bjdgyc/anylink/base" @@ -101,7 +102,12 @@ func logAuditBatch() { // 解析IP包的数据 func logAudit(userName string, pl *sessdata.Payload) { - defer putPayload(pl) + defer func() { + putPayload(pl) + if err := recover(); err != nil { + base.Error("logAudit is panic: ", err, "\n", string(debug.Stack()), "\n", pl.Data) + } + }() if !(pl.LType == sessdata.LTypeIPData && pl.PType == 0x00) { return