Repository navigation
feat(libSceHttp): implement abortable epoll waits - #3706
Merged
Merged
Conversation
… sceHttpWaitRequest Deathloop (PPSA01670) imports sceHttpAbortWaitRequest; Planet Coaster (PPSA01736) and Palworld import sceHttpWaitRequest. Epoll handles are kept in a registry with an abort flag, a destroyed flag and a condition variable. A wait with a negative timeout blocks until sceHttpAbortWaitRequest, sceHttpDestroyEpoll or the sceHttpTerm of the last context wakes it; a bounded wait still returns 0 events. An abort stays set and makes every later wait return SCE_HTTP_ERROR_ABORTED (0x80431080); a wait woken by destroy or term returns 0 events. sceHttpDestroyEpoll no longer frees a handle a waiter is blocked on. sceHttpInit registers its context, and the epoll calls and sceHttpTerm return BEFORE_INIT without a live context and INVALID_ID for an unknown context or handle. Behaviour and error codes: shadPS4 src/core/libraries/network/http.cpp and http_error.h at a8a70da595da2a96e0410309472ba4a7eb558144. Signature (void* eh): Orbital tools/ida/db_types.json at b321fcdbd700cc02da1cb1ad25412781d5ec73c6 and SharpProspero src/SharpProspero/Interop/Net/Http.cs at 60977b29103452b9681ae10c7a9011d44965bf16. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 766997d)
Use an SRW lock and native Windows condition variable for epoll waits, preserving the shared handle lifecycle. This avoids the scheduler-tick overshoot measured with std::condition_variable on Windows. Suggested-by: winstrex
This was referenced Oct 11, 2026
Collaborator
|
Checked build + ctest ( |
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.
What
Carries David's ready implementation from issue #3156, preserving his authorship. Adds
sceHttpAbortWaitRequestand allowssceHttpWaitRequestto wait without a timeout until the epoll is aborted, destroyed, or the last HTTP context ends.The implementation follows shadPS4 for the assumed error codes and lifecycle behavior; these details are not confirmed on PS5 hardware. The timeout is treated as microseconds, and a wait returns zero events because requests do not reach the network. The epoll retains shared ownership while waiters run.
The Windows wait uses the native SRW lock and condition variable to avoid the scheduler-tick overshoot measured on Windows in the issue discussion. The timing observation and approach were contributed by @winstrex and are credited in the follow-up commit.
Tested
guest_http_tests; CTestguest_httppassed 3 consecutive runs.python3 tools/check_conventions.py --base upstream/main --head 776cff0efandgit diff --check upstream/main...HEADpassed.Checklist
main; no other open PR implements these functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository