Repository navigation
fix(endpointbuf): wait_for counts bytes already in the get area - #71
Merged
Merged
Conversation
wait_for polled only the socket. When one recv brought two messages, the second sat in the get area and wait_for reported nothing readable until the peer sent more bytes: a FIX session read the second of two back-to-back execution reports only after the peer's next heartbeat. wait_for now returns true at once while unread bytes are buffered. The WebSocket close drain's comment no longer says wait_for polls only the socket. Co-authored-by: Cursor <cursoragent@cursor.com>
fixer's history pins the fix as first written, on the earlier master, so the fix comes onto v3.5.0 by a merge rather than a rebase. Co-authored-by: Cursor <cursoragent@cursor.com>
The tests of cryptic's that net builds with its own used OpenSSL since v3.0.0, so the Linux test runner failed to link. v3.0.2 keeps OpenSSL inside cryptic's own build. Co-authored-by: Cursor <cursoragent@cursor.com>
Nothing net builds uses OpenSSL. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
endpointbuf::wait_forpolled only the socket. When onerecvbrought two messages, the second sat in the get area andwait_forreported nothing readable until the peer sent more bytes: a FIX session (fixer) read the second of two back-to-back execution reports only after the peer's next heartbeat.wait_fornow returnstrueat once while unread bytes are buffered. The WebSocket close drain's comment no longer sayswait_forpolls only the socket.It also pins cryptic
v3.0.2. Since v3.0.0, one of the cryptic tests that net builds with its own used OpenSSL, so the Linux test runner failed to link and master's CI has been red since v3.5.0. v3.0.2 keeps OpenSSL inside cryptic's own build. Nothing net builds uses OpenSSL, so CI and the dev container no longer installlibssl-dev.The fix was written on the previous master, and fixer's history pins it there, so v3.5.0 comes in by a merge (it merged cleanly) rather than a rebase. Please merge this with a merge commit, not squash or rebase, so the commits fixer pins stay on master.
Testing
net/net-endpoint_stream.test.c++): the client sendsfirst\nsecond\nin one write; after readingfirst,wait_for(200ms)must reportsecondwithout the client sending more../tools/CB.sh debug test --jsonl=failures: 993/993 passed on this tree.Note
Medium Risk
Changes stream readiness semantics for any code using
endpointbuf::wait_for(including WebSocket close draining); behavior is more correct but callers that relied on the old socket-only poll may see earlier readiness.Overview
endpointbuf::wait_forno longer polls only the socket: it returnstrueimmediately when unread bytes remain in the streambuf get area (gptr() < egptr()), so a second message delivered in the samerecvis visible without waiting for more peer traffic (regression tied to back-to-back FIX-style reads).A new BDD scenario in
net-endpoint_stream.test.c++locks this in (first\nsecond\nin one write;wait_forafterfirstmust seesecond). The WebSocket close-drain comment is updated to match buffered-byte behavior.Docs bump the
deps/crypticpin to v3.0.2 in README anddocs/release-policy.md.libssl-devis dropped from the devcontainer Dockerfile, thesetup-llvmdefault package list, and the CI static-analysis LLVM install step.Reviewed by Cursor Bugbot for commit 2ead0f4. Bugbot is set up for automated code reviews on this repo. Configure here.