simple clear

This commit is contained in:
Fangliding
2026-11-26 21:09:18 +08:00
parent 5d796c827a
commit 2e9bac5648
3 changed files with 4 additions and 21 deletions
+1 -6
View File
@@ -397,16 +397,10 @@ type serverSessionState struct {
}
func (st *serverSessionState) check(packetID uint64) bool {
if st.window == nil {
st.window = new(SlidingWindow)
}
return st.window.Check(packetID)
}
func (st *serverSessionState) add(packetID uint64) {
if st.window == nil {
st.window = new(SlidingWindow)
}
st.window.Add(packetID)
}
@@ -479,6 +473,7 @@ func (s *ClientUDPSession) getServerSession(sessionID uint64, now int64) (*serve
newState := &serverSessionState{
sessionID: sessionID,
window: new(SlidingWindow),
cipher: bodyAead,
}
newState.lastSeen.Store(now)