feat(libSceHttp2): store the connection wait timeout like the other timeout setters #17938
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17938"
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 AlfaRojo on 2026-11-10T00:05:36Z.
What
sceHttp2SetConnectionWaitTimeOutstores a connection wait timeout on a template or request and returns0x817B1100for an unknown id, through the library'sUpdatehelper andHttp2::Settingslike the other timeout setters (sceHttp2SetConnectTimeOut,sceHttp2SetRecvTimeOut,sceHttp2SetResolveTimeOut,sceHttp2SetSendTimeOut,sceHttp2SetTimeOut). Where those setters differ from KytyPS5 it follows them: a zero value throws (KytyPS5 stores it) and a context or cookie box id throws (KytyPS5 returns0x817B1100), since the console is not measured for either.Evidence: KytyPS5 at 6fd43ac6, src/libs/libNet.cpp lines 1183-1196, looks the id up among requests and templates, returns
HTTP2_ERROR_INVALID_ID(0x817B1100) otherwise and storesconnection_wait_timeout_us. The export's(int id, uint32_t usec)signature was already declared ininclude/Http2.hpp. Crimson Desert (PPSA25286, #16802) imports this export (NIDn8hMLe31OPA) from its relinkedapp.elf.Still unknown, recorded in
docs/dev/debt/libSceHttp2.md: the console's handling of 0 and of a context id; the default; nothing consumes the stored value, because a request whose context has no free connection slot throws (Transport.cpp, "connection slot waiting is not implemented") instead of waiting, so no console result for an exhausted pool is claimed. The TLS settings debt entry no longer lists the connection-slot wait timeout among the throwing setters.Open pull requests touching the same files: #16936 (WebSocket close/send;
Export.cpparound line 482,GuestHttp2.cpplines 48-135, the debt file's inventory table) and #17735 (timeout/abort codes;Export.cppline 413, the debt file's error paths and SSL callbacks entries). This change editsExport.cpplines 307-310,GuestHttp2.cppafter line 206 and the TLS settings debt entry, none of which those diffs touch. #17570 touchesTransport.cppandGuestHttp2Transport.cpponly.Tested
Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release,
BUILD_TESTING=ON, onmain6719b01bf3.guest_http2: 3 of 3 passed (re-run 3 of 3 on1e8aeedd81after the test change)guest_http2_options,guest_http2_cookies,guest_http2_transport,guest_http2_teardown: passedpublic_headers: passedtools/check_test_registration.py: everycore/libs/prxsource that defines anAPS5_VABIfunction is compiledtools/check_conventions.py --base upstream/main: all conventions checks passedtools/pr_overlap.py: no PR shares an export; #14212 (repository-wide debt reformat, conflicts withmain) shares onlydocs/dev/debt/libSceHttp2.mdand adds no export; #16936, #17735 and #17570 touch the same files on other lines and add other exports.Linux and macOS not run. The setter stores the value through the same Update path the other timeout setters use; nothing platform-specific.
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)Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-10T02:02:21Z.
Review: COMMENTED
Review of head
ab24b8526a, plus a Linux run to go with @JJenkx's Windows check.Title need: Crimson Desert (PPSA25286) imports
sceHttp2SetConnectionWaitTimeOut(NIDn8hMLe31OPA, from its relinkedapp.elf). Our CD runs onmainhaven't reached a call to it yet: with the network on they stop at 1 s insceHttp2SendRequestAsync, and withAPS5_NET_DISCONNECTED=1they hit our memory cap within about 50 s. Naming that import in the description would give the PR its title.Test: two of the new lines pin host refusals that the PR's own debt entry calls unmeasured, and that differ from the only source cited:
Your debt entry says KytyPS5 returns
0x817B1100for a context id and stores 0. If a console run later shows either of those, these lines have to be reverted along with the fix. The sourced behaviour is the store on a template and a request, plus0x817B1100for an unknown id. Pinning only that keeps the test true whichever way the console answers. The code can keep throwing for both cases, as the other timeout setters do.Code: the
NotImplemented_nid_no_patch("sceHttp2SetConnectionWaitTimeOut")literal is right: inside the lambda,__func__would beoperator(). The 30 s default inSettingsisn't sourced, but nothing reads it, and the debt entry already says the default is unmeasured.Linux: Ubuntu 26.04, GCC 15.2, Release,
ctest -R '^(guest_http2.*|public_headers)$', 3 runs each, unmerged. The merge base6719b01bf3and headab24b8526aboth pass 15 of 15 in 3 of 3 runs, with none skipped. That coversguest_http2(the new cases), the options, cookies, transport, HTTP/1, redirects, SSL-callback and teardown suites, andpublic_headers.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-10T05:53:45Z.
Review: APPROVED
Approving
1e8aeedd81: the test now pins only the sourced behaviour, and the change since my Linux run only deletes those two lines.One correction to the checklist, though.
Unblocks: PPSA25286 #16802overstates it. Onmain, Crimson Desert never reaches this call: with the network on it stops at 1 s insceHttp2SendRequestAsync(#11630 implements that), and withAPS5_NET_DISCONNECTED=1our runs hit the memory cap first. So the title imports the setter and will need it, but this PR doesn't unblock it yet.Unblocks: nonewith the import named in the description, as you have it now, would be accurate.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T11:12:41Z.
Review: COMMENTED
Read
1e8aeedd81againstmain.Correctness.
libSceHttp2/Export.cpp:sceHttp2SetConnectionWaitTimeOutnow uses the sameUpdatehelper and zero-valueNotImplementedassceHttp2SetConnectTimeOutandsceHttp2SetRecvTimeOut. An unknown id returns0x817B1100; a context or cookie box, or a handle that already has transport, throws. The value is stored in the newHttp2::Settings::connectionWaitTimeout. Nothing reads it, but the transport still throws on an exhausted connection slot instead of pretending to wait, so no behaviour is faked. The new debt entry says so and notes that the 30 s default is unmeasured.Test. On
mainthe export throws unconditionally, so the newsceHttp2SetConnectionWaitTimeOut(tmpl/request, ...) == 0rows fail there. The-1row covers the invalid id.Non-blocking. The zero-value throw and the context-id throw are not tested, though both are described in the PR and the debt entry. Sibling setters have rows such as
Require(Throws([&] { sceHttp2SetResolveRetry(tmpl, -1); }))just above. Two similar rows here would pin them.Not run here; this is from reading the code.
AI-assisted: yes.