feat(libSceHttp2): store the connection wait timeout like the other timeout setters #17938

Merged
AlfaRojo merged 4 commits from upstream-pr/17938 into main 2026-11-13 08:09:11 +00:00
AlfaRojo commented 2026-11-10 00:05:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlfaRojo on 2026-11-10T00:05:36Z.


What

sceHttp2SetConnectionWaitTimeOut stores a connection wait timeout on a template or request and returns 0x817B1100 for an unknown id, through the library's Update helper and Http2::Settings like 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 returns 0x817B1100), 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 stores connection_wait_timeout_us. The export's (int id, uint32_t usec) signature was already declared in include/Http2.hpp. Crimson Desert (PPSA25286, #16802) imports this export (NID n8hMLe31OPA) from its relinked app.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.cpp around line 482, GuestHttp2.cpp lines 48-135, the debt file's inventory table) and #17735 (timeout/abort codes; Export.cpp line 413, the debt file's error paths and SSL callbacks entries). This change edits Export.cpp lines 307-310, GuestHttp2.cpp after line 206 and the TLS settings debt entry, none of which those diffs touch. #17570 touches Transport.cpp and GuestHttp2Transport.cpp only.

Tested

Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, BUILD_TESTING=ON, on main 6719b01bf3.

  • guest_http2: 3 of 3 passed (re-run 3 of 3 on 1e8aeedd81 after the test change)
  • guest_http2_options, guest_http2_cookies, guest_http2_transport, guest_http2_teardown: passed
  • public_headers: passed
  • tools/check_test_registration.py: every core/libs/prx source that defines an APS5_VABI function is compiled
  • tools/check_conventions.py --base upstream/main: all conventions checks passed
  • tools/pr_overlap.py: no PR shares an export; #14212 (repository-wide debt reformat, conflicts with main) shares only docs/dev/debt/libSceHttp2.md and 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5233302605 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17938). Originally posted by [AlfaRojo](https://github.com/AlfaRojo) on 2026-11-10T00:05:36Z. --- ### What `sceHttp2SetConnectionWaitTimeOut` stores a connection wait timeout on a template or request and returns `0x817B1100` for an unknown id, through the library's `Update` helper and `Http2::Settings` like 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 returns `0x817B1100`), since the console is not measured for either. Evidence: KytyPS5 at 6fd43ac6, [src/libs/libNet.cpp lines 1183-1196](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libNet.cpp#L1183-L1196), looks the id up among requests and templates, returns `HTTP2_ERROR_INVALID_ID` (0x817B1100) otherwise and stores `connection_wait_timeout_us`. The export's `(int id, uint32_t usec)` signature was already declared in `include/Http2.hpp`. Crimson Desert (PPSA25286, #16802) imports this export (NID `n8hMLe31OPA`) from its relinked `app.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.cpp` around line 482, `GuestHttp2.cpp` lines 48-135, the debt file's inventory table) and #17735 (timeout/abort codes; `Export.cpp` line 413, the debt file's error paths and SSL callbacks entries). This change edits `Export.cpp` lines 307-310, `GuestHttp2.cpp` after line 206 and the TLS settings debt entry, none of which those diffs touch. #17570 touches `Transport.cpp` and `GuestHttp2Transport.cpp` only. ### Tested Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, `BUILD_TESTING=ON`, on `main` `6719b01bf3`. - `guest_http2`: 3 of 3 passed (re-run 3 of 3 on `1e8aeedd81` after the test change) - `guest_http2_options`, `guest_http2_cookies`, `guest_http2_transport`, `guest_http2_teardown`: passed - `public_headers`: passed - `tools/check_test_registration.py`: every `core/libs/prx` source that defines an `APS5_VABI` function is compiled - `tools/check_conventions.py --base upstream/main`: all conventions checks passed - `tools/pr_overlap.py`: no PR shares an export; #14212 (repository-wide debt reformat, conflicts with `main`) shares only `docs/dev/debt/libSceHttp2.md` and 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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
milescoviello commented 2026-11-10 02:02:21 +00:00 (Migrated from github.com)

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 (NID n8hMLe31OPA, from its relinked app.elf). Our CD runs on main haven't reached a call to it yet: with the network on they stop at 1 s in sceHttp2SendRequestAsync, and with APS5_NET_DISCONNECTED=1 they 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:

Require(Throws([&] { sceHttp2SetConnectionWaitTimeOut(context, 1000000); }));
Require(Throws([&] { sceHttp2SetConnectionWaitTimeOut(id, 0); }));

Your debt entry says KytyPS5 returns 0x817B1100 for 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, plus 0x817B1100 for 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 be operator(). The 30 s default in Settings isn'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 base 6719b01bf3 and head ab24b8526a both pass 15 of 15 in 3 of 3 runs, with none skipped. That covers guest_http2 (the new cases), the options, cookies, transport, HTTP/1, redirects, SSL-callback and teardown suites, and public_headers.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5835715256 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17938#pullrequestreview-5835715256). Originally posted by [milescoviello](https://github.com/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` (NID `n8hMLe31OPA`, from its relinked `app.elf`). Our CD runs on `main` haven't reached a call to it yet: with the network on they stop at 1 s in `sceHttp2SendRequestAsync`, and with `APS5_NET_DISCONNECTED=1` they 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: ```cpp Require(Throws([&] { sceHttp2SetConnectionWaitTimeOut(context, 1000000); })); Require(Throws([&] { sceHttp2SetConnectionWaitTimeOut(id, 0); })); ``` Your debt entry says KytyPS5 returns `0x817B1100` for 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, plus `0x817B1100` for 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 be `operator()`. The 30 s default in `Settings` isn'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 base `6719b01bf3` and head `ab24b8526a` both pass 15 of 15 in 3 of 3 runs, with none skipped. That covers `guest_http2` (the new cases), the options, cookies, transport, HTTP/1, redirects, SSL-callback and teardown suites, and `public_headers`. AI-assisted: yes (Claude Code)
milescoviello commented 2026-11-10 05:53:45 +00:00 (Migrated from github.com)

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 #16802 overstates it. On main, Crimson Desert never reaches this call: with the network on it stops at 1 s in sceHttp2SendRequestAsync (#11630 implements that), and with APS5_NET_DISCONNECTED=1 our 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: none with the import named in the description, as you have it now, would be accurate.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5837394095 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17938#pullrequestreview-5837394095). Originally posted by [milescoviello](https://github.com/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 #16802` overstates it. On `main`, Crimson Desert never reaches this call: with the network on it stops at 1 s in `sceHttp2SendRequestAsync` (#11630 implements that), and with `APS5_NET_DISCONNECTED=1` our 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: none` with the import named in the description, as you have it now, would be accurate. AI-assisted: yes (Claude Code)
gabichuuuuu commented 2026-11-10 11:12:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T11:12:41Z.

Review: COMMENTED


Read 1e8aeedd81 against main.

Correctness. libSceHttp2/Export.cpp:sceHttp2SetConnectionWaitTimeOut now uses the same Update helper and zero-value NotImplemented as sceHttp2SetConnectTimeOut and sceHttp2SetRecvTimeOut. An unknown id returns 0x817B1100; a context or cookie box, or a handle that already has transport, throws. The value is stored in the new Http2::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 main the export throws unconditionally, so the new sceHttp2SetConnectionWaitTimeOut(tmpl/request, ...) == 0 rows fail there. The -1 row 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5840908938 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17938#pullrequestreview-5840908938). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-10T11:12:41Z. **Review:** COMMENTED --- Read `1e8aeedd81` against `main`. **Correctness.** `libSceHttp2/Export.cpp:sceHttp2SetConnectionWaitTimeOut` now uses the same `Update` helper and zero-value `NotImplemented` as `sceHttp2SetConnectTimeOut` and `sceHttp2SetRecvTimeOut`. An unknown id returns `0x817B1100`; a context or cookie box, or a handle that already has transport, throws. The value is stored in the new `Http2::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 `main` the export throws unconditionally, so the new `sceHttp2SetConnectionWaitTimeOut(tmpl/request, ...) == 0` rows fail there. The `-1` row 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17938
No description provided.