Add more panic information

This commit is contained in:
风扇滑翔翼 2025-05-06 06:33:13 +00:00 committed by GitHub
parent 87ab8e5128
commit 7484097da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@ import (
"crypto"
"crypto/aes"
"crypto/tls"
"fmt"
"encoding/binary"
"io"
@ -47,6 +48,15 @@ var (
)
func SniffQUIC(b []byte) (*SniffHeader, error) {
defer func() {
if r := recover(); r != nil {
fmt.Println("QUIC sniffer panic, please send the information below to the developer.")
fmt.Println("<-------------------- BEGIN QUIC BYTE -------------------->")
fmt.Println(b)
fmt.Println("<--------------------- END QUIC BYTE -------------------->")
panic(r)
}
}()
if len(b) == 0 {
return nil, common.ErrNoClue
}