Repository navigation
Detect a peer reset in half_closed (bsd). - #1031
Merged
evoskuil merged 2 commits intoNov 14, 2026
Merged
Conversation
On freebsd a peer reset drops the connection, so the TCP_INFO query fails with ECONNRESET (an unconnected socket succeeds with TCPS_CLOSED). The failure is now reported as a reset. The peer reset test now also runs on bsd (verified on freebsd 15.1).
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.
half_closed() detected a peer reset (RST) on linux, macos and windows (#1020, #1021). On freebsd only a FIN (CLOSE_WAIT) was detected.
freebsd drops a reset connection, so the TCP_INFO query fails with ECONNRESET, which is now reported as a reset. An unconnected socket does not fail the query (it reports TCPS_CLOSED), so the error is specific to the reset.
The peer reset test now also runs on bsd. Without the change it fails on freebsd 15.1.