forked from OpenPHDGuiding/phd2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
event server: fix possible problems when client sends multiple reques…
…ts (OpenPHDGuiding#1228) The `connect` command can cause the event loop to run and for the event server to process additional buffered client commands. As the JSON parser instance is reused for all client commands, the parser's state will reflect the most recent client command and may lose the state of the unfinished connect command. The fix is to not reuse the JsonParser instance -- instantiate a dedicated parser for each client command. Testing: - manually exercised the event server by issuing commands with an event server client - checked the runtime overhead of instantiating the JsonParser instance per request (negligible, < 100 ns)
- Loading branch information
Showing
2 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters