fix(libSceHttp2): return the console's codes for timeouts, aborts and closed connections #17735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17735"
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 kali113 on 2026-11-09T13:33:47Z.
What
libSceHttp2threwNotImplementedon ordinary network failures: an expired deadline,sceHttp2AbortRequest, a server that closes before the HTTP/1.x headers end, a reset overhttp://, and anothersceHttp2SendRequestafter a complete response. This returns the codes a PS5 payload measured for each of them, on the owner's jailbroken PS5 (sceKernelGetSystemSwVersionreports13.590.001; the owner calls it 13.60). Cases the payload did not settle still throw.sceHttp2SetTimeOut), also during DNS and the TLS handshake0x817B1068http://, HTTPS/1.1, HTTP/2sceHttp2SetRecvTimeOut)0x817B1222http://(send and read), HTTPS/1.1, HTTP/2 (send)sceHttp2AbortRequestduring a send or a read0x817B1080http://, HTTPS/1.1, HTTP/2, TLS handshake0x817B1080http://0x817B1064http://, HTTPS/1.1sceHttp2SetConnectTimeOut) on an unroutable address0x817B1221http://0x817B1223http://0x80410136http://Content-Length, then closehttp://0x817B1066After a failed send, the follow-ups match what the debt file already records:
sceHttp2GetStatusCodereturns 0 and stores 0, the content length and read calls return0x817B1065, and another send repeats the error. After a failed read, the read error repeats and the status and content length stay readable (status 200, length 100).Changes:
Transport.cpp: every deadline carries the code for its phase; the overall deadline wins when it is earlier. A cancelled or expired request raises an internal failure thatSendandReadturn into the measured code (networkResultfor a send, a new stickyreadResultfor a read). Unmeasured phases keep code 0 and still throw: the TLS handshake past its connect deadline (the console did not apply the connect timeout there: a 1 s one let a stalled handshake run 20 s until the probe aborted it), send timeouts over TLS, resolve timeouts, and deleting a request, template or context during an operation. A peer close mid-header raises0x817B1064; chunk-framing truncation still throws.sceHttp2GetResponseContentLength's gzip path converts the internal failure back into a throw, since it is unmeasured.Export.cpp:sceHttp2AbortRequestcreates the transport for a request that has not been sent (not for WebSocket handles), so the abort sticks, as on the console.http://variant of the HTTP/1 fixture with stall-request, close and reset modes, 12 cases for the table above, and one for the gzip length path. Existing TLS deadline and cancellation tests now expect the measured codes where they apply and still expect a throw where they do not.docs/dev/debt/libSceHttp2.md: a new "measured failures" entry; the error-path and SSL-callback entries are shortened.Applied beyond what was measured, and named as such in the debt entry: abort before a send,
0x817B1066and read-phase receive timeouts over every scheme. All three come from libSceHttp2's request state, not the transport, and every code that was measured over more than one scheme matched.Not in this PR:
0x804101E6and a refused connection0x8041013D, both sync and async.Two more console observations that change no code here:
sceHttp2SslDisableOption(…, 0x3d)hung the payload, on a template and on a request.sceHttp2Initwith a 1 MiB pool and 8 requests returned0x817B121C; 256 KiB and 1 request worked.Tested
13.590.001, a payload built with ps5-payload-sdk v0.45, against Python servers on the LAN (plain, TLS with a self-signed certificate accepted throughsceHttp2SetSslCallback, and HTTP/2 via ALPNh2). DNS was a local resolver that answers NXDOMAIN to every name and drops queries for the resolve-timeout case. Four runs; the logs and the probe source are below and in the first comment.-DBUILD_TESTING=ONRelease build in an x86-64 Ubuntu 26.04 container under Rosetta 2 on Apple Silicon, GCC 15.2. That is emulation, not native hardware.guest_http2*tests pass, three runs in a row;guest_http2_transporttakes 8.8 s andguest_http2_http17.1 s.libSceHttp2passes: the 8guest_curl*tests,guest_avplayer_http,avplayer_http_transport,avplayer_http_patched_modules,guest_http_clientandguest_memory_pool_stats.python3 tools/check_conventions.py --base origin/mainpasses.0d73753391: the cleartext short-body test now reads until the body ends, and a variant delivers the body in two pieces. Syntax-checked only; not run.guest_http2*tests on Windows 11 (WinLibs GCC 15.2 UCRT, Release) on head5b6febc388: all pass, 3 of 3 runs, includingguest_http2_http1with the reset fixture'sclosesocketbranch (comment). The hosted Windows job does not run these tests on pull requests.http://connect. The connect timeout is tested with an injected pending connect instead.tools/pr_overlap.pyreports textual overlaps only. #11630, #15221 and #16231 touch the test fixture'sModeline and nearby debt lines; #14212 touches the debt file. None maps these codes.Run 1 and 2 log: init failure, then plain HTTP and async
Run 3 log: read phase, truncation, aborts, resolve and send timeouts (the HTTPS part hung in sceHttp2SslDisableOption)
Run 4 log: HTTPS/1.1, HTTP/2 and TLS handshake, with an SSL callback that accepts the chain
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
Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-09T13:33:57Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.