Repository navigation
Conversation
…waiting for data Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… macOS, so the portability build has the check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
What
On Linux a zero-length
sceNetRecv,sceNetRecvfromorsceNetRecvmsgon a connected TCP socket went to the host, and Linux'stcp_recvmsgwaits for data even when nothing was asked for, so the call blocked until the peer sent something (or the receive timeout ran out). FreeBSD 11.4'ssoreceive_genericreturns 0 at once. Windows already answers this case without the host (boykopovar#8686's check inwait_for_local_address); libkernel'srecvdoes too (ReceiveAnsweredHere).That check moves into
empty_stream_receive, which Windows and Linux share: a connected socket with no pending error or hang-up gets 0 without waiting or consuming data, and a socket on whichsceNetConnectwas never called and that was not accepted getsENOTCONN; the other states still go to the host. On Linuxwait_for_local_addressis just that check for stream sockets, so the three receive functions call it on every host; macOS is not changed.NetEmptyStream.cpp(net_empty_stream_*, 24 cases: empty,MSG_DONTWAIT,MSG_PEEK, non-blocking, queued data, null buffer, error states and a queued datagram, for each of the three calls) was registered on Windows only; it now runs on Linux too. The debt entry for the states that still use the host now names the hosts.Tested
Commit 8ed57e1 on
main4a7fd1c, Release, in a workflow on my fork: https://github.com/Dr-Coconut/AnyPS5/actions/runs/46693583719ubuntu-latest, image ubuntu-26.04, GCC 15.2.0), with the change: all 24net_empty_stream_*tests pass, and so doesguest_sce_net.Export.cpprestored tomainand the test registration kept: 15 of the 24 fail, everyempty,dontwait,peek,nonblockingandnullbufcase of the three calls ("zero-length receive waited for peer data" or "did not return zero");queued,errorsanddatagrampass, as the host already answers those.windows-latest, image windows-2025-vs2026, WinLibs GCC 15.2.015.2.0posix-14.0.0-ucrt-r7), with the change: all 24 andguest_sce_netpass (the Windows path only moved into the shared function).Not run on macOS. No title tested.
tools/check_conventions.pypasses.tools/pr_overlap.py --branchreported no overlap among the open pull requests it could merge; it could not compare eight that conflict withmain. Compared by hand: boykopovar#12682, boykopovar#12688, boykopovar#12700 and boykopovar#12965 rework blocking transfers and connects on Windows; boykopovar#5836 adds peer-socket types; boykopovar#16826 keeps close-on-exec infcntl; boykopovar#18108 changes socket options; boykopovar#23975 adds a DNS override. None of them changes the zero-length receive path.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit