Complete deferred audit LOWs: kicker-cache eviction, abandoned-challenge reclaim, and a challenge-response gossip handshake
All checks were successful
CI / check (push) Successful in 5m7s

This commit is contained in:
Jean Chevronnet 2026-07-20 04:53:03 +00:00
parent 4027242c1e
commit 3723617367
No known key found for this signature in database
3 changed files with 87 additions and 19 deletions

View file

@ -151,6 +151,13 @@ impl GameServ {
ctx.notice(me, from.uid, "You cannot challenge yourself.");
return;
}
// Reclaim pending challenges both of whose parties have since gone offline:
// an abandoned offer can never be accepted, so it shouldn't keep holding a
// slot against the caps below. Active games are left alone (a player may
// reconnect and resume).
self.games.retain(|_, g| {
g.status != Status::Pending || net.uid_by_nick(&g.nick_a).is_some() || net.uid_by_nick(&g.nick_b).is_some()
});
// Global cap: the per-user cap keys on a churnable identity (a guest's nick),
// so a single connection could otherwise cycle nicks to grow the games map
// without bound. Bounding the total makes that impossible regardless.