Skip to content

Detect a peer reset in half_closed (bsd). - #1031

Merged
evoskuil merged 2 commits into
libbitcoin:masterfrom
eynhaender:fix/peer-reset-monitor-bsd
Nov 14, 2026
Merged

evoskuil merged 2 commits into
libbitcoin:masterfrom
eynhaender:fix/peer-reset-monitor-bsd

Conversation

@eynhaender

Copy link
Copy Markdown
Member

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.

eynhaender and others added 2 commits November 13, 2026 20:38
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).
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.776%. remained the same — eynhaender:fix/peer-reset-monitor-bsd into libbitcoin:master

@evoskuil
evoskuil merged commit a414165 into libbitcoin:master Nov 14, 2026
28 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants