feat(libSceHttp): add synchronous HTTP request transport #9834

Open
DoubleAAGuy wants to merge 17 commits from upstream-pr/9834 into main
DoubleAAGuy commented 2026-10-22 16:51:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DoubleAAGuy on 2026-10-22T16:51:39Z.


What

Implement a synchronous HTTP/1.1 request path in libSceHttp over the existing libSceNet and libSceSsl libraries. Connections and requests retain their URL/method and request headers; sceHttpSendRequest sends the request and parses response status/headers, while sceHttpReadData streams fixed-length, chunked, or connection-close bodies. Status, content length, response headers, TLS verification callbacks, DNS/connect/I/O timeouts, and automatic redirects are wired into this path. DNS lookups use a bounded process-lifetime worker pool so the configured resolve deadline bounds the caller even though libc getaddrinfo cannot be cancelled; late results are discarded. Connect timeouts use a nonblocking socket plus libSceNet epoll; cross-origin redirects drop caller-supplied Authorization, Proxy-Authorization, Cookie, and Host headers.

The concrete caller is Prospero Themes (PPSA90210): its StoreHttpClient loads libSceHttp and libSceSsl and uses GET/POST, request headers, TLS callbacks, response headers and body reads for its community store.

Nonblocking requests and epoll completion events, request-side chunked transfer, persistent connection reuse, gzip, cookies/authentication and proxy routing remain unsupported. TLS uses libSceSsl verification and the caller's verify callback, including PPSA90210's accept-certificate callback; other HTTP-specific TLS flags remain unimplemented.

Tested

AArch64 Linux host; focused x86-64 build and execution under QEMU user emulation:

  • Built the actual libc, libkernel, libSceNetCtl, libSceNet, libSceSsl, libSceHttp, and committed HTTP test targets using GCC 12.2.0 in an out-of-tree CMake harness.
  • Ran guest_http, guest_http_response_header, guest_http_options, guest_http_transport, and guest_http_transport_context_allocation under QEMU x86-64 emulation; all five passed. guest_http_transport includes fixed-length/chunked bodies, redirects with cross-origin credential stripping, deterministic DNS/connect timeout cases, and a TLS loopback exchange whose untrusted certificate is accepted through the supplied verification callback. The allocation test sweeps 16 one-shot failure budgets with and without an existing context, checks failed-context rollback and retry, and verifies failed IDs have neither pool stats nor transport templates.
  • python3 tools/check_conventions.py --base origin/main, syntax checks for changed sources/tests, and Request.cpp with -Wall -Wextra -Werror passed.

This was not a native x86-64 run or a full project build. The standard root CMake configuration is unavailable here because SDL lacks XRandR development support; the focused CMake harness bypassed the unrelated SDL build. No PS5 console test was available.

Overlap review

tools/pr_overlap.py --branch feat/libscehttp-request-transport --repo boykopovar/AnyPS5 could not run to completion because this host has Git 2.34.1 and the tool uses the newer git merge-tree --write-tree interface. I manually reviewed the overlapping work. #8357 has merged and is in the current base; this PR now registers its pool-size metadata transactionally with HTTP options and transport state. #9630 remains a dependency for the context/epoll allocation-safety changes. #8620 has been closed without title evidence; its cookie-limit changes are not included, so this PR owns the transport debt update. #9417, #9405 and #9413 have since merged and are in the current base; this PR does not modify their request-header-removal, auth-option or cookie-option behavior. #8541’s TLS test CMake hunk is no longer touched, and #9073’s author confirmed no exact hunk overlap after the UriCopy debt-line change. #6044’s test reorganization is handled by placing the new test in tests/networking; the uncomparable #8646 offline-import hunk does not change the assertion modified here.

Checklist

  • Based on current main; no other open PR implements the same request 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: #9630
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4970987926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834). Originally posted by [DoubleAAGuy](https://github.com/DoubleAAGuy) on 2026-10-22T16:51:39Z. --- ### What Implement a synchronous HTTP/1.1 request path in `libSceHttp` over the existing `libSceNet` and `libSceSsl` libraries. Connections and requests retain their URL/method and request headers; `sceHttpSendRequest` sends the request and parses response status/headers, while `sceHttpReadData` streams fixed-length, chunked, or connection-close bodies. Status, content length, response headers, TLS verification callbacks, DNS/connect/I/O timeouts, and automatic redirects are wired into this path. DNS lookups use a bounded process-lifetime worker pool so the configured resolve deadline bounds the caller even though libc `getaddrinfo` cannot be cancelled; late results are discarded. Connect timeouts use a nonblocking socket plus `libSceNet` epoll; cross-origin redirects drop caller-supplied `Authorization`, `Proxy-Authorization`, `Cookie`, and `Host` headers. The concrete caller is Prospero Themes (`PPSA90210`): its [StoreHttpClient](https://github.com/Darkatek7/ProsperoThemes/blob/7bbf66c043fc57d4695efb3e647a5d9dd54e64d1/ThemeApp/Library/StoreHttpClient.cs) loads `libSceHttp` and `libSceSsl` and uses GET/POST, request headers, TLS callbacks, response headers and body reads for its community store. Nonblocking requests and epoll completion events, request-side chunked transfer, persistent connection reuse, gzip, cookies/authentication and proxy routing remain unsupported. TLS uses `libSceSsl` verification and the caller's verify callback, including PPSA90210's accept-certificate callback; other HTTP-specific TLS flags remain unimplemented. ### Tested AArch64 Linux host; focused x86-64 build and execution under QEMU user emulation: - Built the actual `libc`, `libkernel`, `libSceNetCtl`, `libSceNet`, `libSceSsl`, `libSceHttp`, and committed HTTP test targets using GCC 12.2.0 in an out-of-tree CMake harness. - Ran `guest_http`, `guest_http_response_header`, `guest_http_options`, `guest_http_transport`, and `guest_http_transport_context_allocation` under QEMU x86-64 emulation; all five passed. `guest_http_transport` includes fixed-length/chunked bodies, redirects with cross-origin credential stripping, deterministic DNS/connect timeout cases, and a TLS loopback exchange whose untrusted certificate is accepted through the supplied verification callback. The allocation test sweeps 16 one-shot failure budgets with and without an existing context, checks failed-context rollback and retry, and verifies failed IDs have neither pool stats nor transport templates. - `python3 tools/check_conventions.py --base origin/main`, syntax checks for changed sources/tests, and `Request.cpp` with `-Wall -Wextra -Werror` passed. This was not a native x86-64 run or a full project build. The standard root CMake configuration is unavailable here because SDL lacks XRandR development support; the focused CMake harness bypassed the unrelated SDL build. No PS5 console test was available. ### Overlap review `tools/pr_overlap.py --branch feat/libscehttp-request-transport --repo boykopovar/AnyPS5` could not run to completion because this host has Git 2.34.1 and the tool uses the newer `git merge-tree --write-tree` interface. I manually reviewed the overlapping work. #8357 has merged and is in the current base; this PR now registers its pool-size metadata transactionally with HTTP options and transport state. #9630 remains a dependency for the context/epoll allocation-safety changes. #8620 has been closed without title evidence; its cookie-limit changes are not included, so this PR owns the transport debt update. #9417, #9405 and #9413 have since merged and are in the current base; this PR does not modify their request-header-removal, auth-option or cookie-option behavior. #8541’s TLS test CMake hunk is no longer touched, and #9073’s author confirmed no exact hunk overlap after the UriCopy debt-line change. #6044’s test reorganization is handled by placing the new test in `tests/networking`; the uncomparable #8646 offline-import hunk does not change the assertion modified here. ### 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 request 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: #9630 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-22 17:18:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T17:18:00Z.

Review: CHANGES_REQUESTED


Blocking findings in the current draft:

  1. connectTimeOutUsec does not bound connection establishment. CreateSocketStream applies it as SO_SNDTIMEO, then calls sceNetConnect; the current libSceNet implementation uses blocking connect, and on Windows waits in select with no timeout. A peer that does not complete the handshake can therefore block indefinitely despite the configured connect timeout. Please implement a deadline-aware connect and test it, or explicitly leave this option unsupported and record that in the debt entry.

  2. Automatic redirects reuse request.requestHeaders unchanged after current changes. A cross-origin redirect (including HTTPS to HTTP) can forward caller-supplied Authorization or Cookie headers to the new server. Strip sensitive credentials when the origin changes, and add a redirect test that verifies they are not forwarded; ensure the Host header cannot remain pinned to the old origin either.

  3. The overlap report for this head flags a direct libSceSsl/CMakeLists.txt conflict with #8541 and a libSceHttp.md conflict with #9073. The body lists #9630, #8357 and #8620 but does not mention these overlaps. Please agree on sequencing with those authors and record the actual merge dependency/order in the checklist as CONTRIBUTING.md requires.

The current hosted run has conventions/intake/labels checks, but no build or test jobs. The PR reports syntax checks and temporary plain-HTTP loopback smoke tests; the committed guest_http_transport and TLS integration tests were source-checked but not run. Please run the committed focused transport tests on a supported host before marking the PR ready, including the TLS path.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5618112029 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5618112029). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T17:18:00Z. **Review:** CHANGES_REQUESTED --- Blocking findings in the current draft: 1. `connectTimeOutUsec` does not bound connection establishment. `CreateSocketStream` applies it as `SO_SNDTIMEO`, then calls `sceNetConnect`; the current `libSceNet` implementation uses blocking `connect`, and on Windows waits in `select` with no timeout. A peer that does not complete the handshake can therefore block indefinitely despite the configured connect timeout. Please implement a deadline-aware connect and test it, or explicitly leave this option unsupported and record that in the debt entry. 2. Automatic redirects reuse `request.requestHeaders` unchanged after `current` changes. A cross-origin redirect (including HTTPS to HTTP) can forward caller-supplied `Authorization` or `Cookie` headers to the new server. Strip sensitive credentials when the origin changes, and add a redirect test that verifies they are not forwarded; ensure the `Host` header cannot remain pinned to the old origin either. 3. The overlap report for this head flags a direct `libSceSsl/CMakeLists.txt` conflict with #8541 and a `libSceHttp.md` conflict with #9073. The body lists #9630, #8357 and #8620 but does not mention these overlaps. Please agree on sequencing with those authors and record the actual merge dependency/order in the checklist as CONTRIBUTING.md requires. The current hosted run has conventions/intake/labels checks, but no build or test jobs. The PR reports syntax checks and temporary plain-HTTP loopback smoke tests; the committed `guest_http_transport` and TLS integration tests were source-checked but not run. Please run the committed focused transport tests on a supported host before marking the PR ready, including the TLS path.
MarcZX10 commented 2026-10-22 17:55:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T17:55:52Z.

Review: CHANGES_REQUESTED


Blocking security issue in automatic redirects: PerformSend follows a Location to a newly parsed URL but reuses request.requestHeaders unchanged, and BuildRequest emits every retained header on each hop. A caller-supplied Authorization or other origin-scoped credential header is therefore sent to an unrelated host if the original server redirects there. The feature supports both automatic redirects and arbitrary request headers, so please strip sensitive headers when scheme/host/effective port changes (and add a loopback cross-origin redirect test proving the second server does not receive them). The existing relative redirect test does not cover this case.

The integration HTTP/TLS tests are reported source-checked but not executed locally; only native fixed/chunked smoke tests ran, with no TLS. CI product jobs are skipped. Also, the PR base is 0def01bc and current main is a6646f84 (44 commits ahead); please rebase after the redirect fix and rerun the committed transport tests on the final head. The declared dependencies on #9630, #8357, and #8620 are still open and are correctly listed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5618582699 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5618582699). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T17:55:52Z. **Review:** CHANGES_REQUESTED --- Blocking security issue in automatic redirects: `PerformSend` follows a `Location` to a newly parsed URL but reuses `request.requestHeaders` unchanged, and `BuildRequest` emits every retained header on each hop. A caller-supplied `Authorization` or other origin-scoped credential header is therefore sent to an unrelated host if the original server redirects there. The feature supports both automatic redirects and arbitrary request headers, so please strip sensitive headers when scheme/host/effective port changes (and add a loopback cross-origin redirect test proving the second server does not receive them). The existing relative redirect test does not cover this case. The integration HTTP/TLS tests are reported source-checked but not executed locally; only native fixed/chunked smoke tests ran, with no TLS. CI product jobs are skipped. Also, the PR base is `0def01bc` and current `main` is `a6646f84` (44 commits ahead); please rebase after the redirect fix and rerun the committed transport tests on the final head. The declared dependencies on #9630, #8357, and #8620 are still open and are correctly listed.
MarcZX10 commented 2026-10-22 20:29:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T20:29:32Z.

Review: COMMENTED


I re-reviewed the latest head 3381f7297ac4679fd49beab9467474e2b5f08320. The earlier redirect credential leak is addressed: authorization, proxy authorization, cookie, and host headers are removed when scheme, host, or effective port changes, and the author reports a cross-origin loopback test. The focused x86-64 build and QEMU test runs are also described with their limits. The current hosted product jobs (Linux, Windows, relinker, write-watch, and register-context) are skipped; conventions, eligibility, labels, and report pass. I did not run the transport tests locally. No additional actionable finding in this pass. I note the PR remains draft while its stated dependencies #9630, #8357, and #8620 are open and native x86-64 validation is outstanding.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5620443847 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5620443847). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T20:29:32Z. **Review:** COMMENTED --- I re-reviewed the latest head `3381f7297ac4679fd49beab9467474e2b5f08320`. The earlier redirect credential leak is addressed: authorization, proxy authorization, cookie, and host headers are removed when scheme, host, or effective port changes, and the author reports a cross-origin loopback test. The focused x86-64 build and QEMU test runs are also described with their limits. The current hosted product jobs (Linux, Windows, relinker, write-watch, and register-context) are skipped; conventions, eligibility, labels, and report pass. I did not run the transport tests locally. No additional actionable finding in this pass. I note the PR remains draft while its stated dependencies #9630, #8357, and #8620 are open and native x86-64 validation is outstanding.
MarcZX10 commented 2026-10-29 05:33:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:33:01Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The current head still has a Windows link failure, and the chunked-response parser leaves both trailer size and consumed-buffer growth unbounded.

What I ran

  • Reviewed exact head 449a38aa084128589a9c63aab3fe2366dd8bc339 against current main 52c09d567d.
  • Ran git merge-tree --write-tree and git diff --check against current main.
  • Inspected the current CMake target links, Windows workflow failure log, and chunked-body parsing/buffering code.
  • I did not run the C++ tests locally.

Results

Check Result
Current-main merge preview Clean
git diff --check Pass
Exact-head Windows hosted job Fails linking libSceHttp
Linker errors Undefined references to __imp_getaddrinfo and __imp_freeaddrinfo from Request.cpp and Resolver.cpp
Focused transport tests The PR body reports five x86-64 QEMU tests; I did not independently rerun them
Other hosted checks Conventions, eligibility, labels, and report pass; product Linux and specialized jobs are skipped

Negative control

  • Not run. The hosted link failure is on the exact PR head. The failure log identifies Winsock resolver symbols and the CMake target’s missing Windows system library.

Findings

Blocking

  1. Windows libSceHttp does not link. The current target links only libSceNet and libSceSsl. The exact-head Windows workflow fails while linking libSceHttp with unresolved __imp_getaddrinfo and __imp_freeaddrinfo references from the newly added resolver/request objects. Please link ws2_32 to libSceHttp under WIN32, then rerun the Windows build and focused tests. The test executables’ ws2_32 links do not fix the library target’s own unresolved imports.

  2. Chunk trailers have no total size limit. ReadChunkedBody loops over trailer lines until it sees an empty line, applying only the 8,192-byte per-line limit. A peer can send an unbounded number of individually valid lines. The loop does not enforce the configured response-header maximum, so the parser can keep reading indefinitely and retain unbounded pending data. Apply a total trailer-section bound and add a test that exceeds it.

Non-blocking

  • ReadLine appends each received block to pending and advances pendingOffset but never compacts consumed bytes. With a long chunked response containing many small chunks, this retains consumed input for the lifetime of the response. Drop consumed prefixes once the offset is large enough, and cover a long many-chunk body in the regression suite.

Sources

Not verified

  • I did not reproduce the Windows link failure locally or run the transport tests.
  • The native Windows 104-test run posted in the thread used a separate branch stacked on #9630 and included extra transport/link fixes; it does not establish that this exact head links.
  • Linux product CI is skipped, and no console run is reported here.

To get this to a good state

Add the Windows resolver library to libSceHttp, bound the total chunk-trailer section, compact consumed pending data, and add the related regression cases. Then rerun the focused HTTP transport tests and exact-head Windows build with the complete dependency stack.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693296448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5693296448). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T05:33:01Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The current head still has a Windows link failure, and the chunked-response parser leaves both trailer size and consumed-buffer growth unbounded. ## What I ran - Reviewed exact head 449a38aa084128589a9c63aab3fe2366dd8bc339 against current main 52c09d567d2fa453494dd720fcf53a98149468e4. - Ran git merge-tree --write-tree and git diff --check against current main. - Inspected the current CMake target links, Windows workflow failure log, and chunked-body parsing/buffering code. - I did not run the C++ tests locally. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | git diff --check | Pass | | Exact-head Windows hosted job | Fails linking libSceHttp | | Linker errors | Undefined references to __imp_getaddrinfo and __imp_freeaddrinfo from Request.cpp and Resolver.cpp | | Focused transport tests | The PR body reports five x86-64 QEMU tests; I did not independently rerun them | | Other hosted checks | Conventions, eligibility, labels, and report pass; product Linux and specialized jobs are skipped | ## Negative control - Not run. The hosted link failure is on the exact PR head. The failure log identifies Winsock resolver symbols and the CMake target’s missing Windows system library. ## Findings ### Blocking 1. **Windows libSceHttp does not link.** The current target links only libSceNet and libSceSsl. The exact-head Windows workflow fails while linking libSceHttp with unresolved __imp_getaddrinfo and __imp_freeaddrinfo references from the newly added resolver/request objects. Please link ws2_32 to libSceHttp under WIN32, then rerun the Windows build and focused tests. The test executables’ ws2_32 links do not fix the library target’s own unresolved imports. 2. **Chunk trailers have no total size limit.** ReadChunkedBody loops over trailer lines until it sees an empty line, applying only the 8,192-byte per-line limit. A peer can send an unbounded number of individually valid lines. The loop does not enforce the configured response-header maximum, so the parser can keep reading indefinitely and retain unbounded pending data. Apply a total trailer-section bound and add a test that exceeds it. ### Non-blocking - ReadLine appends each received block to pending and advances pendingOffset but never compacts consumed bytes. With a long chunked response containing many small chunks, this retains consumed input for the lifetime of the response. Drop consumed prefixes once the offset is large enough, and cover a long many-chunk body in the regression suite. ## Sources - [CMake target links at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/449a38aa084128589a9c63aab3fe2366dd8bc339/core/libs/prx/libSceHttp/CMakeLists.txt#L1-L5) - [Chunk line buffering at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/449a38aa084128589a9c63aab3fe2366dd8bc339/core/libs/prx/libSceHttp/src/Request.cpp#L271-L310) - [Chunk trailer loop at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/449a38aa084128589a9c63aab3fe2366dd8bc339/core/libs/prx/libSceHttp/src/Request.cpp#L692-L722) - [Exact-head Windows workflow](https://github.com/boykopovar/AnyPS5/actions/runs/40812290513) ## Not verified - I did not reproduce the Windows link failure locally or run the transport tests. - The native Windows 104-test run posted in the thread used a separate branch stacked on #9630 and included extra transport/link fixes; it does not establish that this exact head links. - Linux product CI is skipped, and no console run is reported here. ## To get this to a good state Add the Windows resolver library to libSceHttp, bound the total chunk-trailer section, compact consumed pending data, and add the related regression cases. Then rerun the focused HTTP transport tests and exact-head Windows build with the complete dependency stack.
MarcZX10 commented 2026-10-30 06:30:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T06:30:09Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

On head b6df6465e75b9c7ed6184dd1023e3be7aece34fd, the new context-allocation rollback coverage is useful, but the HTTP transport still has unbounded chunk trailers and the Windows library link remains unverified after a prior failure.

What I ran

  • Exact PR head: b6df6465e75b9c7ed6184dd1023e3be7aece34fd; recorded PR base: 102c4f95a24d97dd7d000fb1830f26c103d03342.
  • Current main: 3b32cc7b61f1c09bff248c4a788ca7cf95f78ce0; merge preview was clean (760c612f6ecfec4b30289986e23b667168ad1c3b).
  • Environment: Linux x86_64, Git 2.39.5, Python 3. No compiler was invoked; no local build or CTest run.
  • Commands:
git merge-tree --write-tree upstream/main refs/pr/9834
git diff --check upstream/main...refs/pr/9834
python3 tools/check_conventions.py --base upstream/main --head refs/pr/9834
python3 tools/check_main_sync.py --base upstream/main --head refs/pr/9834
gh pr checks 9834 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview and diff check Clean merge; git diff --check exited 0 with no output.
Conventions Passed.
Current-main sync 10 commits ahead and 28 behind; merge is clean. The PR's changed paths have no additional main-side changes since its recorded base.
Source and dependency review libSceHttp calls host getaddrinfo/freeaddrinfo but its target does not declare ws2_32. Open PR #10957 changes the same CMake file and adds ws2_32; the overlap requires author agreement and a declared landing order under the repository rule. #9630 is declared as a dependency; #11134 is stacked on #9834. #8646's uncomparable GuestOfflineImports.cpp insertion was manually checked and is in a separate test block.
Hosted checks on this head Windows is still running; report, conventions, eligibility and labels pass. Linux and specialized jobs are skipped. A prior Windows run on head 449a38aa084128589a9c63aab3fe2366dd8bc339 failed; that result does not establish the outcome for this head.
Focused HTTP tests A commenter reports 104 native Windows tests passing on stacked head 3f6fd99c78, which included separate ws2_32 and chunk-trailer fixes plus a test fix. This is useful author-provided evidence, but it is not the live PR head and was not independently reproduced.
Unedited check output
760c612f6ecfec4b30289986e23b667168ad1c3b
All conventions checks passed.
refs/pr/9834 is 10 ahead and 28 behind upstream/main (merge base 102c4f95a)
merge: clean
windows	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922737269
report	pass	51s	https://github.com/boykopovar/AnyPS5/actions/runs/41011652911/job/123918648622
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922738557
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922738519
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739527
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739277
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739061
conventions	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/41011650226/job/123918640769
eligibility	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123918648505
labels	pass	8s	https://github.com/boykopovar/AnyPS5/actions/runs/41011650319/job/123918641017

Negative control

Assertion Change to code under test Did the new test fail?
Allocation-failure rollback leaves no partially registered HTTP context No mutation run; the C++ test target was not built or executed locally. Not exercised in this review.

Findings

Blocking

  1. Windows resolver symbols are not explicitly linked by libSceHttp. Resolver.cpp calls host getaddrinfo/freeaddrinfo, while this head's target links only libSceNet and libSceSsl. A previous Windows workflow failed on the earlier head; the exact-head Windows job is still pending. Add the required Windows socket library to libSceHttp and verify the current head's Windows job.

  2. Chunked trailers have no aggregate size limit. The zero-size chunk path reads trailer lines until an empty line, applying only the per-line kMaximumChunkLine limit. A peer can send an unbounded number of individually valid lines and keep the response reader consuming data. Bound the whole trailer section and add a regression that exceeds that bound.

  3. The overlapping CMake changes lack a declared landing order. The current #9834 checklist does not declare #10957, although both change libSceHttp/CMakeLists.txt and the #10957 version adds the Windows socket-library link. Please agree with that PR's author which change lands first and record the dependency on the appropriate checklist line.

Non-blocking

ReadLine advances pendingOffset and appends new input to pending without dropping consumed bytes. With a long chunked response, the buffer retains prior chunk data; compact consumed prefixes and cover a many-chunk response to bound this growth.

Sources

Not verified

I did not build or run CTest locally, exercise a negative control, or run console behavior. The current Windows job was pending when checked; Linux product and specialized hosted jobs were skipped. The reported 104-test Windows run used a different stacked head with separate fixes, and the five QEMU tests are author-reported; neither was independently reproduced here.

To get this to a good state

Add the Windows socket-library link, cap total chunk-trailer bytes with a regression test, and record the agreed #10957 landing order. Keep the declared #9630 dependency. I will rerun the same source checks and review the exact new head and its updated CI after those changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708821522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5708821522). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T06:30:09Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested On head `b6df6465e75b9c7ed6184dd1023e3be7aece34fd`, the new context-allocation rollback coverage is useful, but the HTTP transport still has unbounded chunk trailers and the Windows library link remains unverified after a prior failure. ## What I ran - Exact PR head: `b6df6465e75b9c7ed6184dd1023e3be7aece34fd`; recorded PR base: `102c4f95a24d97dd7d000fb1830f26c103d03342`. - Current `main`: `3b32cc7b61f1c09bff248c4a788ca7cf95f78ce0`; merge preview was clean (`760c612f6ecfec4b30289986e23b667168ad1c3b`). - Environment: Linux x86_64, Git 2.39.5, Python 3. No compiler was invoked; no local build or CTest run. - Commands: ```sh git merge-tree --write-tree upstream/main refs/pr/9834 git diff --check upstream/main...refs/pr/9834 python3 tools/check_conventions.py --base upstream/main --head refs/pr/9834 python3 tools/check_main_sync.py --base upstream/main --head refs/pr/9834 gh pr checks 9834 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview and diff check | Clean merge; `git diff --check` exited 0 with no output. | | Conventions | Passed. | | Current-main sync | 10 commits ahead and 28 behind; merge is clean. The PR's changed paths have no additional main-side changes since its recorded base. | | Source and dependency review | `libSceHttp` calls host `getaddrinfo`/`freeaddrinfo` but its target does not declare `ws2_32`. Open PR #10957 changes the same CMake file and adds `ws2_32`; the overlap requires author agreement and a declared landing order under the repository rule. #9630 is declared as a dependency; #11134 is stacked on #9834. #8646's uncomparable `GuestOfflineImports.cpp` insertion was manually checked and is in a separate test block. | | Hosted checks on this head | Windows is still running; report, conventions, eligibility and labels pass. Linux and specialized jobs are skipped. A prior Windows run on head `449a38aa084128589a9c63aab3fe2366dd8bc339` failed; that result does not establish the outcome for this head. | | Focused HTTP tests | A commenter reports 104 native Windows tests passing on stacked head `3f6fd99c78`, which included separate `ws2_32` and chunk-trailer fixes plus a test fix. This is useful author-provided evidence, but it is not the live PR head and was not independently reproduced. | <details> <summary>Unedited check output</summary> ```text 760c612f6ecfec4b30289986e23b667168ad1c3b All conventions checks passed. refs/pr/9834 is 10 ahead and 28 behind upstream/main (merge base 102c4f95a) merge: clean windows pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922737269 report pass 51s https://github.com/boykopovar/AnyPS5/actions/runs/41011652911/job/123918648622 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922738557 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922738519 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739527 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739277 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123922739061 conventions pass 17s https://github.com/boykopovar/AnyPS5/actions/runs/41011650226/job/123918640769 eligibility pass 4s https://github.com/boykopovar/AnyPS5/actions/runs/41011652869/job/123918648505 labels pass 8s https://github.com/boykopovar/AnyPS5/actions/runs/41011650319/job/123918641017 ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Allocation-failure rollback leaves no partially registered HTTP context | No mutation run; the C++ test target was not built or executed locally. | Not exercised in this review. | ## Findings ### Blocking 1. **Windows resolver symbols are not explicitly linked by `libSceHttp`.** `Resolver.cpp` calls host `getaddrinfo`/`freeaddrinfo`, while this head's target links only `libSceNet` and `libSceSsl`. A previous Windows workflow failed on the earlier head; the exact-head Windows job is still pending. Add the required Windows socket library to `libSceHttp` and verify the current head's Windows job. 2. **Chunked trailers have no aggregate size limit.** The zero-size chunk path reads trailer lines until an empty line, applying only the per-line `kMaximumChunkLine` limit. A peer can send an unbounded number of individually valid lines and keep the response reader consuming data. Bound the whole trailer section and add a regression that exceeds that bound. 3. **The overlapping CMake changes lack a declared landing order.** The current #9834 checklist does not declare #10957, although both change `libSceHttp/CMakeLists.txt` and the #10957 version adds the Windows socket-library link. Please agree with that PR's author which change lands first and record the dependency on the appropriate checklist line. ### Non-blocking `ReadLine` advances `pendingOffset` and appends new input to `pending` without dropping consumed bytes. With a long chunked response, the buffer retains prior chunk data; compact consumed prefixes and cover a many-chunk response to bound this growth. ## Sources - [Current `libSceHttp` target at head `b6df6465e75b9c7ed6184dd1023e3be7aece34fd`](https://github.com/boykopovar/AnyPS5/blob/b6df6465e75b9c7ed6184dd1023e3be7aece34fd/core/libs/prx/libSceHttp/CMakeLists.txt#L1-L5) - [Resolver calls at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/b6df6465e75b9c7ed6184dd1023e3be7aece34fd/core/libs/prx/libSceHttp/src/Resolver.cpp#L100-L112) - [Overlapping #10957 CMake change at its head](https://github.com/boykopovar/AnyPS5/blob/dbdc41e773010bc23ad743e793731149d3c71a50/core/libs/prx/libSceHttp/CMakeLists.txt#L1-L6) - [Line reader and pending-buffer handling at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/b6df6465e75b9c7ed6184dd1023e3be7aece34fd/core/libs/prx/libSceHttp/src/Request.cpp#L271-L291) - [Chunk trailer loop at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/b6df6465e75b9c7ed6184dd1023e3be7aece34fd/core/libs/prx/libSceHttp/src/Request.cpp#L692-L718) - [Overlap-order rule at current `main` `3b32cc7b61f1c09bff248c4a788ca7cf95f78ce0`](https://github.com/boykopovar/AnyPS5/blob/3b32cc7b61f1c09bff248c4a788ca7cf95f78ce0/CONTRIBUTING.md#L67-L68) - [Comment with the reported Windows run on stacked head `3f6fd99c78`](https://github.com/boykopovar/AnyPS5/pull/9834#issuecomment-6472144996) - [Previous Windows workflow on head `449a38aa084128589a9c63aab3fe2366dd8bc339`](https://github.com/boykopovar/AnyPS5/actions/runs/40812290513) - [Current Windows workflow on head `b6df6465e75b9c7ed6184dd1023e3be7aece34fd`](https://github.com/boykopovar/AnyPS5/actions/runs/41011652869) ## Not verified I did not build or run CTest locally, exercise a negative control, or run console behavior. The current Windows job was pending when checked; Linux product and specialized hosted jobs were skipped. The reported 104-test Windows run used a different stacked head with separate fixes, and the five QEMU tests are author-reported; neither was independently reproduced here. ## To get this to a good state Add the Windows socket-library link, cap total chunk-trailer bytes with a regression test, and record the agreed #10957 landing order. Keep the declared #9630 dependency. I will rerun the same source checks and review the exact new head and its updated CI after those changes.
MarcZX10 commented 2026-11-14 10:03:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T10:03:53Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix the connection-timeout conversion so a configured timeout is interpreted in microseconds by epoll.

What I ran

Reviewed head 974dfd5adeacd42557add90af180f96d06742d88 using the prepared diff and repo_read.py for relevant source ranges. No build or tests were run; reported test results below are author supplied.

Results

Check Result Note
Source review failed Connection timeout unit mismatch
Focused tests not run Author reports five tests passed
Native/console checks not run Not available per description

Findings

Blocking

  • core/libs/prx/libSceHttp/src/Request.cpp:763: sceNetEpollWait receives the configured timeout directly, but its timeout argument is in milliseconds while usec is microseconds. A configured one second deadline therefore waits about one millisecond, and smaller values truncate to zero, causing valid connections to fail prematurely. Convert microseconds to the epoll API's unit with appropriate rounding and bounds before waiting.

Non-blocking

None.

Not verified

Did not run tests, build, native x86-64 execution, Windows execution, or PS5 console behavior. Author reports five focused tests passed under QEMU x86-64 emulation on an AArch64 Linux host with GCC 12.2.0. Read Export.cpp, Request.cpp, Resolver.cpp and the relevant ranges of diff.patch; other changed files and excluded files listed in files.json were not read. The repository reader was pinned to the stated head.

To get this to a good state

Correct the timeout unit conversion, then rerun the focused transport tests and timeout coverage on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5903623687 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-5903623687). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T10:03:53Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix the connection-timeout conversion so a configured timeout is interpreted in microseconds by epoll. ## What I ran Reviewed head `974dfd5adeacd42557add90af180f96d06742d88` using the prepared diff and `repo_read.py` for relevant source ranges. No build or tests were run; reported test results below are author supplied. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Connection timeout unit mismatch | | Focused tests | not run | Author reports five tests passed | | Native/console checks | not run | Not available per description | ## Findings ### Blocking - `core/libs/prx/libSceHttp/src/Request.cpp:763`: `sceNetEpollWait` receives the configured timeout directly, but its timeout argument is in milliseconds while `usec` is microseconds. A configured one second deadline therefore waits about one millisecond, and smaller values truncate to zero, causing valid connections to fail prematurely. Convert microseconds to the epoll API's unit with appropriate rounding and bounds before waiting. ### Non-blocking None. ## Not verified Did not run tests, build, native x86-64 execution, Windows execution, or PS5 console behavior. Author reports five focused tests passed under QEMU x86-64 emulation on an AArch64 Linux host with GCC 12.2.0. Read `Export.cpp`, `Request.cpp`, `Resolver.cpp` and the relevant ranges of `diff.patch`; other changed files and excluded files listed in `files.json` were not read. The repository reader was pinned to the stated head. ## To get this to a good state Correct the timeout unit conversion, then rerun the focused transport tests and timeout coverage on the new head.
MarcZX10 commented 2026-12-03 08:39:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T08:39:39Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 6f0f98b3a5cfe2aec1cc3091ec8ea81e3b7c31e1 against main. I inspected the prepared diff and targeted source sections using shell tools and repo_read.py; no merged-preview check or build was run.

python3 repo_read.py cat core/libs/prx/libSceHttp/src/Request.cpp 321 356
python3 repo_read.py cat core/libs/prx/libSceHttp/src/Resolver.cpp 39 85
rg -n '^diff --git|^@@' diff.patch

Results

Check Result Note
Source review passed Targeted changed code inspected
Build and runtime checks not run No compilation or tests run
Negative control not run No test change or execution

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceHttp/src/Resolver.cpp:64-65 adds every lookup to an unbounded queue. If concurrent calls accumulate while resolver workers are occupied in getaddrinfo, queued jobs retain their host and service strings even after callers time out. Consider bounding the queue or rejecting excess work.

Sources

Not verified

No build, tests, native x86-64 run, or PS5 console behavior was verified. The focused test runs described by the author were not run during this review. The manifest lists no excluded files. Reviewed changed paths: core/libs/prx/libSceAvPlayer/CMakeLists.txt, core/libs/prx/libSceHttp/CMakeLists.txt, core/libs/prx/libSceHttp/Export.cpp, core/libs/prx/libSceHttp/src/Request.cpp, core/libs/prx/libSceHttp/src/Request.hpp, core/libs/prx/libSceHttp/src/Resolver.cpp, core/libs/prx/libSceHttp/src/Resolver.hpp, core/libs/tests/AvPlayerHttpModules.cmake, core/libs/tests/GuestHttp.cpp, core/libs/tests/GuestOfflineImports.cpp, core/libs/tests/HttpTransportContextAllocation.cpp, core/libs/tests/networking/GuestHttpTransport.cpp, and docs/dev/debt/libSceHttp.md.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6166261400 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9834#pullrequestreview-6166261400). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-03T08:39:39Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `6f0f98b3a5cfe2aec1cc3091ec8ea81e3b7c31e1` against `main`. I inspected the prepared diff and targeted source sections using shell tools and `repo_read.py`; no merged-preview check or build was run. ```text python3 repo_read.py cat core/libs/prx/libSceHttp/src/Request.cpp 321 356 python3 repo_read.py cat core/libs/prx/libSceHttp/src/Resolver.cpp 39 85 rg -n '^diff --git|^@@' diff.patch ``` ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Targeted changed code inspected | | Build and runtime checks | not run | No compilation or tests run | | Negative control | not run | No test change or execution | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceHttp/src/Resolver.cpp:64-65` adds every lookup to an unbounded queue. If concurrent calls accumulate while resolver workers are occupied in `getaddrinfo`, queued jobs retain their host and service strings even after callers time out. Consider bounding the queue or rejecting excess work. ## Sources - [Resolver queue and timeout handling at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/6f0f98b3a5cfe2aec1cc3091ec8ea81e3b7c31e1/core/libs/prx/libSceHttp/src/Resolver.cpp#L54-L85) - [Resolver worker count and queue storage at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/6f0f98b3a5cfe2aec1cc3091ec8ea81e3b7c31e1/core/libs/prx/libSceHttp/src/Resolver.cpp#L39-L45) ## Not verified No build, tests, native x86-64 run, or PS5 console behavior was verified. The focused test runs described by the author were not run during this review. The manifest lists no excluded files. Reviewed changed paths: `core/libs/prx/libSceAvPlayer/CMakeLists.txt`, `core/libs/prx/libSceHttp/CMakeLists.txt`, `core/libs/prx/libSceHttp/Export.cpp`, `core/libs/prx/libSceHttp/src/Request.cpp`, `core/libs/prx/libSceHttp/src/Request.hpp`, `core/libs/prx/libSceHttp/src/Resolver.cpp`, `core/libs/prx/libSceHttp/src/Resolver.hpp`, `core/libs/tests/AvPlayerHttpModules.cmake`, `core/libs/tests/GuestHttp.cpp`, `core/libs/tests/GuestOfflineImports.cpp`, `core/libs/tests/HttpTransportContextAllocation.cpp`, `core/libs/tests/networking/GuestHttpTransport.cpp`, and `docs/dev/debt/libSceHttp.md`. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/9834:upstream-pr/9834'
git switch 'upstream-pr/9834'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/9834'
git switch 'upstream-pr/9834'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/9834'
git switch 'upstream-pr/9834'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/9834'
git switch 'main'
git merge --squash 'upstream-pr/9834'
git switch 'main'
git merge --ff-only 'upstream-pr/9834'
git switch 'main'
git merge 'upstream-pr/9834'
git push origin 'main'
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!9834
No description provided.