test(net): reset the closed peer with unread data so the send fails at once #2295
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2295"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-09T14:55:05Z.
What
guest_sce_netchecks that a send fails once the peer has closed its socket. It closes the accepted socket after a clean exchange and gives the client 100 sends, 1 ms apart, to see the failure. That relies on the peer's RST arriving within ~100 ms. On a Windows host with a WFP network filter installed (Cloudflare WARP and ProtonVPN here), the client's sends keep succeeding for ~19 s: 1213 to 1214 tries in 3 of 3 runs, past the 100-try loop, so the test aborts atRequire(send_failed). A plain Winsock program with the same sequence and no AnyPS5 code does the same (1205 to 1207 tries, ~19 s, thenWSAECONNABORTED), so it is the host, not libSceNet.Before closing the accepted socket, the client now sends one more message, and the test waits on the existing epoll until the accepted socket has it. Closing a TCP socket with unread received data sends a RST at once (RFC 2525 2.17, and what Windows, Linux and FreeBSD do), so the next send fails on the first try whatever filter is installed. The check is unchanged: a send to a reset peer fails.
In the plain Winsock program, closing with unread data made the next send fail on try 1 in 5 of 5 runs (
WSAECONNRESET).Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
BUILD_TESTING=ON, RTX 4060, ond70b8998.guest_sce_net: failed on every run before;--repeat until-fail:10passes after.ctest: 507/507 passed (1 skipped by design).tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same change.mdfiles or images added to the repository