mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-10 16:00:11 +07:00
optimize(udp)/fix(quicSniffer): optimize performance of udp and fix a potential panic of quic (#301)
This commit is contained in:
@ -5,13 +5,13 @@ package trie
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/daeuniverse/softwind/pkg/zeroalloc/buffer"
|
||||
"math/bits"
|
||||
"net/netip"
|
||||
"sort"
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/common/bitlist"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
)
|
||||
|
||||
var ValidCidrChars = NewValidChars([]byte{'0', '1'})
|
||||
@ -100,8 +100,8 @@ func Prefix2bin128(prefix netip.Prefix) (bin128 string) {
|
||||
n += 96
|
||||
}
|
||||
ip := prefix.Addr().As16()
|
||||
buf := buffer.NewBuffer(128)
|
||||
defer buf.Put()
|
||||
buf := pool.GetBuffer()
|
||||
defer pool.PutBuffer(buf)
|
||||
loop:
|
||||
for i := 0; i < len(ip); i++ {
|
||||
for j := 7; j >= 0; j-- {
|
||||
|
Reference in New Issue
Block a user