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 diff --git a/server/handler/payload_tcp_parser.go b/server/handler/payload_tcp_parser.go index 6d3c4cc..95c9a0d 100644 --- a/server/handler/payload_tcp_parser.go +++ b/server/handler/payload_tcp_parser.go @@ -29,7 +29,7 @@ func onTCP(payload []byte) (uint8, string) { } func sniNewParser(b []byte) (uint8, string) { - if len(b) < 2 || b[0] != 0x16 || b[1] != 0x03 { + if len(b) < 6 || b[0] != 0x16 || b[1] != 0x03 { return acc_proto_tcp, "" } rest := b[5:]