feat(libSceHttp): check the arguments of sceHttpSetProxy #9229

Merged
YossiYad merged 3 commits from upstream-pr/9229 into main 2026-10-22 06:09:21 +00:00
YossiYad commented 2026-10-21 15:42:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T15:42:01Z.


What

sceHttpSetProxy threw. It now checks its arguments the way shadPS4's http.cpp does:

  • ERROR_BEFORE_INIT with no live context
  • ERROR_INVALID_VALUE (0x804311FE) for a null host
  • ERROR_INVALID_ID for an id that is not a live template, connection or request (looked up through the per-object options from #8245)
  • 0 otherwise

No request reaches the network here, so the proxy is not kept. shadPS4 stores it. The debt file lists the call under Silent stubs, and its "unknown signature" line goes away. Not measured on a PS5.

The signature is shadPS4's (id, HTTP proxy conf, WLAN proxy conf, host, port). main (from #9137) declares the same types and names the two middle parameters mode and authentication. This change does not read them, so either naming fits.

Tested

Linux (Fedora 44, GCC, Ninja, -DBUILD_TESTING=ON), based on main cecb540a63:

  • guest_http_options (core/libs/tests/GuestHttpOptions.cpp) calls sceHttpSetProxy on a live template, connection and request. It checks the null host, the null host on an unknown id (host before id), an unknown id, and the call after the last sceHttpTerm. It aborts on main.
  • Each of 3 mutations makes the test fail: dropping the init, host or id check.
  • Full ctest: 1793 of 1801 pass. The 8 failures fail the same way on main on this machine and do not link libSceHttp: application_heap_scripting, application_heap_lazy, agc_driver_guest_memory_lifetime, agc_driver_image_array_window_past_layer_limit, agc_driver_tessellation and the three net_dontwait_blocking_* cases.
  • tools/progress.py --compare: libraries +0.01%, 1 function implemented, none lost.
  • tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py finds #8620 (cookie setters in the same files).

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:4954282015 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-21T15:42:01Z. --- ### What `sceHttpSetProxy` threw. It now checks its arguments the way [shadPS4's http.cpp](https://github.com/shadps4-emu/shadPS4/blob/a808e76/src/core/libraries/network/http.cpp) does: - `ERROR_BEFORE_INIT` with no live context - `ERROR_INVALID_VALUE` (0x804311FE) for a null host - `ERROR_INVALID_ID` for an id that is not a live template, connection or request (looked up through the per-object options from #8245) - 0 otherwise No request reaches the network here, so the proxy is not kept. shadPS4 stores it. The debt file lists the call under Silent stubs, and its "unknown signature" line goes away. Not measured on a PS5. The signature is shadPS4's `(id, HTTP proxy conf, WLAN proxy conf, host, port)`. `main` (from #9137) declares the same types and names the two middle parameters `mode` and `authentication`. This change does not read them, so either naming fits. ### Tested Linux (Fedora 44, GCC, Ninja, `-DBUILD_TESTING=ON`), based on `main` `cecb540a63`: - `guest_http_options` (`core/libs/tests/GuestHttpOptions.cpp`) calls `sceHttpSetProxy` on a live template, connection and request. It checks the null host, the null host on an unknown id (host before id), an unknown id, and the call after the last `sceHttpTerm`. It aborts on `main`. - Each of 3 mutations makes the test fail: dropping the init, host or id check. - Full `ctest`: 1793 of 1801 pass. The 8 failures fail the same way on `main` on this machine and do not link libSceHttp: `application_heap_scripting`, `application_heap_lazy`, `agc_driver_guest_memory_lifetime`, `agc_driver_image_array_window_past_layer_limit`, `agc_driver_tessellation` and the three `net_dontwait_blocking_*` cases. - `tools/progress.py --compare`: libraries +0.01%, 1 function implemented, none lost. - `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` finds #8620 (cookie setters in the same files). ### 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
github-actions[bot] commented 2026-10-21 15:42:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T15:42:50Z.


Progress report (4a17c71 → abaaa66)

📈 System libraries: 42.0% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceHttp sceHttpSetProxy
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6320048330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6320048330). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T15:42:50Z. --- <!-- progress-report --> ### Progress report (4a17c71 → abaaa66) 📈 **System libraries**: 42.0% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceHttp | `sceHttpSetProxy` | </details>
github-actions[bot] commented 2026-10-21 16:45:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T16:45:25Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9417 core/libs/tests/GuestHttpOptions.cpp L34

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 8620 core/libs/prx/libSceHttp/Export.cpp
docs/dev/debt/libSceHttp.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321399154 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6321399154). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T16:45:25Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 9417](https://www.github.com/boykopovar/AnyPS5/pull/9417) | `core/libs/tests/GuestHttpOptions.cpp` [L34](https://github.com/boykopovar/AnyPS5/blob/4a17c71757644170c6a0acfcc67fb17f81cff93f/core/libs/tests/GuestHttpOptions.cpp#L34) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 8620](https://www.github.com/boykopovar/AnyPS5/pull/8620) | `core/libs/prx/libSceHttp/Export.cpp`<br>`docs/dev/debt/libSceHttp.md` |
xXPBSXx commented 2026-10-21 19:18:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T19:18:33Z.


Independent Windows run of this PR (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against main is clean. I built only guest_http_options_tests; ctest -N -R guest_http_options lists exactly one test.

PR head tested: 7d68514167fa65ab4e1507f52129c06b5122b24d.

Results (3 runs each):

  • PR head: guest_http_options passes 3/3.
  • Baseline: I kept the PR's test and replaced only core/libs/prx/libSceHttp/Export.cpp with the version from the PR's merge base (cecb540a63), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.

Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324480257 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6324480257). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T19:18:33Z. --- Independent Windows run of this PR (data only). **Environment:** Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against `main` is clean. I built only `guest_http_options_tests`; `ctest -N -R guest_http_options` lists exactly one test. **PR head tested:** `7d68514167fa65ab4e1507f52129c06b5122b24d`. **Results (3 runs each):** - PR head: `guest_http_options` passes 3/3. - Baseline: I kept the PR's test and replaced only `core/libs/prx/libSceHttp/Export.cpp` with the version from the PR's merge base (`cecb540a63`), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards. **Not run:** other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code).
YossiYad commented 2026-10-21 19:43:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T19:43:23Z.


Thanks @xXPBSXx for the Windows run, and for the baseline with Export.cpp reverted that shows the test fails without the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324961690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6324961690). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-21T19:43:23Z. --- Thanks @xXPBSXx for the Windows run, and for the baseline with `Export.cpp` reverted that shows the test fails without the change.
YossiYad commented 2026-10-22 05:34:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T05:34:53Z.


Rebased onto main da54c652e after #9137 (head abaaa66a6). sceHttpSetProxy now keeps main's parameter types and the hostname name, and the checks are unchanged. guest_http_options passes 3 of 3.

@oneandonlydean @adriadam10 ready from my side: CI is green, and xXPBSXx's Windows run shows the test failing with main's Export.cpp.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333572879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6333572879). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-22T05:34:53Z. --- Rebased onto `main` `da54c652e` after #9137 (head `abaaa66a6`). `sceHttpSetProxy` now keeps `main`'s parameter types and the `hostname` name, and the checks are unchanged. `guest_http_options` passes 3 of 3. @oneandonlydean @adriadam10 ready from my side: CI is green, and xXPBSXx's Windows run shows the test failing with `main`'s `Export.cpp`.
oneandonlydean commented 2026-10-22 05:48:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T05:48:54Z.


@YossiYad thanks, it's in my review queue now. I'll come back here with the result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333760162 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9229#issuecomment-6333760162). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-22T05:48:54Z. --- @YossiYad thanks, it's in my review queue now. I'll come back here with the result.
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!9229
No description provided.