fix(gameserver): discard a malformed client frame instead of dropping the session #95
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!95
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/graceful-malformed-message"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code-review finding SEC-2 (+ T3 coverage).
A
ClientMessagewith an unknowntypediscriminator or an out-of-range enum makesProtocolJson.DeserializethrowJsonException. That wasn't in the receive loop's catch filter (onlyWebSocketException/OperationCanceledException), so it bubbled up unhandled and force-closed the connection — bypassing the author's intended gracefuldefault:path.Catch
JsonExceptionin the receive loop, log at debug, and skip the frame (it was fully read, so the next receive starts clean). The session survives a modified client's garbage.Integration test: a
{"type":"bogus"}frame followed by a validMoveRequeststill applies the move (a dropped session would time out).Definition of Done