1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-18 08:50:25 +08:00

fix: multi-segment hash checking

This commit is contained in:
源文雨
2025-04-03 00:00:21 +09:00
parent 6fc45333d8
commit 0c2f201bd0
15 changed files with 227 additions and 209 deletions

View File

@@ -49,7 +49,7 @@ type Me struct {
// 本机未接收完全分片池
recving *ttl.Cache[uint16, head.PacketBytes]
// 抗重放攻击记录池
recved *ttl.Cache[uint32, struct{}]
recved *ttl.Cache[uint64, struct{}]
// 本机上层配置
srcport, dstport, mtu, speedloop uint16
// 报头掩码
@@ -143,7 +143,7 @@ func NewMe(cfg *MyConfig) (m Me) {
binary.BigEndian.PutUint64(buf[:], m.mask)
logrus.Infoln("[me] xor mask", hex.EncodeToString(buf[:]))
m.recving = ttl.NewCache[uint16, head.PacketBytes](time.Second * 10)
m.recved = ttl.NewCache[uint32, struct{}](time.Minute)
m.recved = ttl.NewCache[uint64, struct{}](time.Minute)
return
}