Repository navigation
Fix server connection accept path robustness - #32
Merged
Merged
Conversation
Co-authored-by: Anže Škerjanc <95276291+anzeskerjancDS@users.noreply.github.com>
…upgrade request Co-authored-by: Anže Škerjanc <95276291+anzeskerjancDS@users.noreply.github.com>
Co-authored-by: Anže Škerjanc <95276291+anzeskerjancDS@users.noreply.github.com>
A client that connects but never sends the HTTP upgrade request used to hold its socket and buffers open forever. The pre-upgrade read now expires after 5s and the connection is closed. Co-authored-by: Anže Škerjanc <95276291+anzeskerjancDS@users.noreply.github.com>
JakaMohorko
approved these changes
Nov 19, 2026
Signal the server connection only after the user context is stored, the test thread reads it right after the wait.
Write handlers queued past the deadline can still run after the test body returns, so they must not reference its stack locals. Hold the completed-writes counter in a shared atomic instead of capturing a local size_t by reference (also removes the data race on it).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief
Harden the server's accept phase (before the websocket upgrade) so one misbehaving client can no longer block, stall, or corrupt the upgrade of other connections.
Description
Previously the server kept one shared buffer and request object for reading upgrade requests, and only re-armed the acceptor after the current connection's upgrade request had been read. This allowed:
Changes:
flat_bufferand request object for the upgrade request, instead of the sharedacceptBuffer/acceptRequestmembers (removed fromServerclass members)test_server_accept.cpp, which drives the accept phase with raw TCP sockets:MalformedRequestDoesNotPoisonLaterConnectionsSilentClientDoesNotBlockOtherConnectionsSilentClientIsDisconnectedReplaces the closed wider scope #31