feat(libSceHttp2): implement request option getters, header removal a… #10536

Merged
noamroger merged 1 commit from upstream-pr/10536 into main 2026-10-27 11:00:53 +00:00
noamroger commented 2026-10-24 08:49:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by noamroger on 2026-10-24T08:49:17Z.


What

Implements seven pending libSceHttp2 exports on top of the merged transport: sceHttp2RemoveRequestHeader, sceHttp2GetAuthEnabled, sceHttp2GetAutoRedirect, sceHttp2AuthCacheFlush, sceHttp2RedirectCacheFlush, sceHttp2SetAuthInfoCallback and sceHttp2SetPreSendCallback.

  • All state lives in Http2::Settings: redirect becomes an int (the stored value is read back unchanged), and the auth-info and pre-send callbacks are added there, so sceHttp2CreateRequestWithURL copies them with the rest and they freeze once transport exists. The transport never calls them.
  • Update() can now return the invalid-id error for contexts and cookie boxes, and propagate an error from its update; the option, header and callback calls use that. Other setters keep throwing for those kinds.
  • Http2::AddHeader returns 0x817B11FE for a null name or value (after removing the name in mode 0); sceHttp2AddRequestHeader checks the mode and then Connection (0x804311FE) before the id.
  • sceHttp2RemoveRequestHeader returns 0x817B1025 for a null or missing name; the getters read the settings even after send; sceHttp2AuthCacheFlush validates the context; sceHttp2RedirectCacheFlush ignores its argument (listed under Silent stubs).
  • Kinds, defaults, copying, modes, error codes and their order follow the 13.42 module results posted in this PR's review. The one deviation is a null pointer to sceHttp2GetAuthEnabled, which throws instead of writing through it. The pending-export count in the debt file drops from 12 to 5.

Tested

Linux (Ubuntu, GCC), full build: ctest --test-dir build -R guest_http2 passes (guest_http2, guest_http2_cookies, guest_http2_options, guest_http2_transport, guest_http2_early_response). guest_http2_options covers a request created after a template change and the immutable-after-send case. python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py cannot run in my environment; open PRs touching libSceHttp2 were checked by hand (#9598, #11145 and #11470 already conflict with main, and none implements these exports).

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 (#10167 and #10534 are merged; this PR is rebased onto them)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4993984785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10536). Originally posted by [noamroger](https://github.com/noamroger) on 2026-10-24T08:49:17Z. --- ### What Implements seven pending libSceHttp2 exports on top of the merged transport: `sceHttp2RemoveRequestHeader`, `sceHttp2GetAuthEnabled`, `sceHttp2GetAutoRedirect`, `sceHttp2AuthCacheFlush`, `sceHttp2RedirectCacheFlush`, `sceHttp2SetAuthInfoCallback` and `sceHttp2SetPreSendCallback`. - All state lives in `Http2::Settings`: `redirect` becomes an `int` (the stored value is read back unchanged), and the auth-info and pre-send callbacks are added there, so `sceHttp2CreateRequestWithURL` copies them with the rest and they freeze once transport exists. The transport never calls them. - `Update()` can now return the invalid-id error for contexts and cookie boxes, and propagate an error from its update; the option, header and callback calls use that. Other setters keep throwing for those kinds. - `Http2::AddHeader` returns `0x817B11FE` for a null name or value (after removing the name in mode 0); `sceHttp2AddRequestHeader` checks the mode and then `Connection` (`0x804311FE`) before the id. - `sceHttp2RemoveRequestHeader` returns `0x817B1025` for a null or missing name; the getters read the settings even after send; `sceHttp2AuthCacheFlush` validates the context; `sceHttp2RedirectCacheFlush` ignores its argument (listed under Silent stubs). - Kinds, defaults, copying, modes, error codes and their order follow the 13.42 module results posted in this PR's review. The one deviation is a null pointer to `sceHttp2GetAuthEnabled`, which throws instead of writing through it. The pending-export count in the debt file drops from 12 to 5. ### Tested Linux (Ubuntu, GCC), full build: `ctest --test-dir build -R guest_http2` passes (`guest_http2`, `guest_http2_cookies`, `guest_http2_options`, `guest_http2_transport`, `guest_http2_early_response`). `guest_http2_options` covers a request created after a template change and the immutable-after-send case. `python3 tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` cannot run in my environment; open PRs touching libSceHttp2 were checked by hand (#9598, #11145 and #11470 already conflict with `main`, and none implements these exports). ### Checklist - [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 (#10167 and #10534 are merged; this PR is rebased onto them) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-24 12:04:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T12:04:20Z.

Review: DISMISSED


This overlaps #10167 in core/libs/prx/libSceHttp2/Export.cpp, and #10167 is an open transport rewrite that replaces this file. The repository contribution rules require authors of overlapping PRs to agree on order and record the prerequisite with Depends on. The checklist currently says Depends on: none, and the PR description only notes the textual conflict. Please coordinate with #10167’s author and update the dependency/order in the checklist before merge; otherwise the combined result has not been reviewed or validated.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638172186 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10536#pullrequestreview-5638172186). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T12:04:20Z. **Review:** DISMISSED --- This overlaps #10167 in `core/libs/prx/libSceHttp2/Export.cpp`, and #10167 is an open transport rewrite that replaces this file. The repository contribution rules require authors of overlapping PRs to agree on order and record the prerequisite with `Depends on`. The checklist currently says `Depends on: none`, and the PR description only notes the textual conflict. Please coordinate with #10167’s author and update the dependency/order in the checklist before merge; otherwise the combined result has not been reviewed or validated.
adriadam10 commented 2026-10-26 20:46:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T20:46:06Z.

Review: CHANGES_REQUESTED


#10167 has merged and this PR now conflicts with main in CMakeLists.txt, Export.cpp, Http2.hpp and docs/dev/debt/libSceHttp2.md. The textual conflicts are the smaller part; the design needs an author decision:

  • Http2::Settings (Transport.hpp) already stores headers, auth and redirect, and Http2::AddHeader and Update() in Export.cpp already implement sceHttp2AddRequestHeader, sceHttp2SetAuthEnabled and sceHttp2SetAutoRedirect. The new authEnabled, autoRedirect and headers fields on Http2Handle duplicate that state, and the template-to-request copy is already done through handle.settings = parent->settings in sceHttp2CreateRequestWithURL.
  • The semantics you measured on 13.42 differ from what main now does: setters accept any int for redirect (main throws unless it is 0 or 1), mode/Connection/id check order and error codes, and Remove/Get on kinds other than templates and requests. Please move the measured behaviour into Update() and Http2::AddHeader, and implement sceHttp2RemoveRequestHeader, sceHttp2GetAuthEnabled and sceHttp2GetAutoRedirect on Settings, keeping the rule that settings are immutable once transport exists (Update() currently throws then; decide what the getters and Remove do in that case).
  • Keep the auth-info and pre-send callbacks in Settings so they are copied with the rest. Say in the debt file that the transport never calls them, and state which of the two now-merged debt entries ("TLS settings", "transport") they extend.
  • Rebase onto main, keep guest_http2_cookies, guest_http2_transport and guest_http2_early_response in CMakeLists.txt next to guest_http2_options, and extend the guest_http2_options test to cover a request created after a template change and the immutable-after-send case.
  • Update the "pending exports" count in the debt file (12 on main now, minus the seven you implement).

Thanks to BunnyFl and wachi35676 for the 13.42 and Windows runs; their results still apply once the code sits on Settings.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5658731227 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10536#pullrequestreview-5658731227). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-26T20:46:06Z. **Review:** CHANGES_REQUESTED --- #10167 has merged and this PR now conflicts with `main` in `CMakeLists.txt`, `Export.cpp`, `Http2.hpp` and `docs/dev/debt/libSceHttp2.md`. The textual conflicts are the smaller part; the design needs an author decision: - `Http2::Settings` (`Transport.hpp`) already stores `headers`, `auth` and `redirect`, and `Http2::AddHeader` and `Update()` in `Export.cpp` already implement `sceHttp2AddRequestHeader`, `sceHttp2SetAuthEnabled` and `sceHttp2SetAutoRedirect`. The new `authEnabled`, `autoRedirect` and `headers` fields on `Http2Handle` duplicate that state, and the template-to-request copy is already done through `handle.settings = parent->settings` in `sceHttp2CreateRequestWithURL`. - The semantics you measured on 13.42 differ from what `main` now does: setters accept any int for redirect (`main` throws unless it is 0 or 1), mode/Connection/id check order and error codes, and `Remove`/`Get` on kinds other than templates and requests. Please move the measured behaviour into `Update()` and `Http2::AddHeader`, and implement `sceHttp2RemoveRequestHeader`, `sceHttp2GetAuthEnabled` and `sceHttp2GetAutoRedirect` on `Settings`, keeping the rule that settings are immutable once `transport` exists (`Update()` currently throws then; decide what the getters and Remove do in that case). - Keep the auth-info and pre-send callbacks in `Settings` so they are copied with the rest. Say in the debt file that the transport never calls them, and state which of the two now-merged debt entries ("TLS settings", "transport") they extend. - Rebase onto `main`, keep `guest_http2_cookies`, `guest_http2_transport` and `guest_http2_early_response` in `CMakeLists.txt` next to `guest_http2_options`, and extend the `guest_http2_options` test to cover a request created after a template change and the immutable-after-send case. - Update the "pending exports" count in the debt file (12 on `main` now, minus the seven you implement). Thanks to BunnyFl and wachi35676 for the 13.42 and Windows runs; their results still apply once the code sits on `Settings`.
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!10536
No description provided.