chore: decrease memory copy in quic sniffer

This commit is contained in:
wwqgtxx
2023-10-19 23:51:37 +08:00
parent 8e637a2ec7
commit ea7e15b447
5 changed files with 41 additions and 35 deletions

View File

@ -51,10 +51,7 @@ func (sd *SnifferDispatcher) UDPSniff(packet C.PacketAdapter) bool {
overrideDest := config.OverrideDest
if inWhitelist {
var copyBuf = make([]byte, len(packet.Data()))
copy(copyBuf, packet.Data())
host, err := sniffer.SniffData(copyBuf)
host, err := sniffer.SniffData(packet.Data())
if err != nil {
continue
}