Skip to content

#134 tests/stream: Windows-side coverage for fwrite() after peer RST - #152

Merged
EdmondDantes merged 1 commit into
mainfrom
134-windows-verify-a-blocked-fwrite-detects-a-peer-connection-reset
May 27, 2026
Merged

EdmondDantes merged 1 commit into
mainfrom
134-windows-verify-a-blocked-fwrite-detects-a-peer-connection-reset

Conversation

@EdmondDantes

Copy link
Copy Markdown
Contributor

POSIX test 046-write_wakes_on_peer_reset.phpt asserts that the second fwrite() on a peer-reset socket fails — that timing is specific to the POSIX poll/POLLERR path and the test is --SKIPIF--'d on Windows.

Local Windows run shows the IOCP reactor does propagate the reset: the first multi-MiB fwrite() is accepted by Winsock buffers, then within a couple of small writes WSAECONNRESET (errno 10054) lands and feof() goes true. The writer does not hang.

Add a Windows-only counterpart that asserts the portable invariants without over-specifying the schedule:

  • the writer does not hang,
  • within a bounded number of post-RST writes one returns false/0,
  • feof() is true after the failing write.

The original POSIX test is left untouched.

POSIX test 046-write_wakes_on_peer_reset.phpt asserts that the *second*
fwrite() on a peer-reset socket fails — that timing is specific to the
POSIX poll/POLLERR path and the test is --SKIPIF--'d on Windows.

Local Windows run shows the IOCP reactor does propagate the reset: the
first multi-MiB fwrite() is accepted by Winsock buffers, then within a
couple of small writes WSAECONNRESET (errno 10054) lands and feof() goes
true. The writer does not hang.

Add a Windows-only counterpart that asserts the portable invariants
without over-specifying the schedule:

  - the writer does not hang,
  - within a bounded number of post-RST writes one returns false/0,
  - feof() is true after the failing write.

The original POSIX test is left untouched.
@EdmondDantes EdmondDantes linked an issue May 27, 2026 that may be closed by this pull request
@EdmondDantes
EdmondDantes merged commit 856742d into main May 27, 2026
7 checks passed
@EdmondDantes
EdmondDantes deleted the 134-windows-verify-a-blocked-fwrite-detects-a-peer-connection-reset branch May 27, 2026 07:12
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.

Windows: verify a blocked fwrite() detects a peer connection reset

1 participant