Skip to content

p9: drain extra bytes from message that's larger than msize #27

Description

@DeedleFake

Currently, if ReadMessage() tries to read a message that's longer than msize, it stops and returns an error. If the connected client is actually a valid client, however, but somehow messed up its msize, this means that the server is left in a position that it can't recover from very cleanly.

A possible fix for this would be for the server to drain the remaining bytes from the long message, allowing the next call to ReadMessage() to read a hopefully valid message. The question, however, is should ReadMessage() handle this automatically in this way. I'm leaning heavily towards it doing so, but I'm a bit worried that it could cause other problems.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions