Repository navigation
feat(libSceHttp): add synchronous HTTP request transport - #9834
DoubleAAGuy wants to merge 17 commits into
Conversation
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Blocking findings in the current draft:
-
connectTimeOutUsecdoes not bound connection establishment.CreateSocketStreamapplies it asSO_SNDTIMEO, then callssceNetConnect; the currentlibSceNetimplementation uses blockingconnect, and on Windows waits inselectwith 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. -
Automatic redirects reuse
request.requestHeadersunchanged aftercurrentchanges. A cross-origin redirect (including HTTPS to HTTP) can forward caller-suppliedAuthorizationorCookieheaders to the new server. Strip sensitive credentials when the origin changes, and add a redirect test that verifies they are not forwarded; ensure theHostheader cannot remain pinned to the old origin either. -
The overlap report for this head flags a direct
libSceSsl/CMakeLists.txtconflict with #8541 and alibSceHttp.mdconflict 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.
850daf1 to
6b25d44
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
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.
5ed4b54 to
549d1a7
Compare
|
Addressed the two code findings in the new head: connect now switches the socket to nonblocking for |
549d1a7 to
9546f1f
Compare
|
Rebased #9834 onto current The requested code fixes are in the current head: nonblocking connect plus epoll deadline and SO_ERROR check, and stripping Authorization/Proxy-Authorization/Cookie/Host on cross-origin redirects with a loopback test. On overlap sequencing: #8541 no longer conflicts because the TLS test moved into |
9546f1f to
0eecfe5
Compare
|
The latest head is rebased on current I built the actual HTTP/network/SSL/kernel/libc targets and the committed tests with x86-64 GCC 12.2 in a focused out-of-tree CMake harness, then ran |
MarcZX10
left a comment
There was a problem hiding this comment.
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.
|
I re-reviewed the latest head |
3381f72 to
e43c472
Compare
|
Update: rebased the current PR head onto |
e43c472 to
f17e10b
Compare
|
I added the concrete DNS-timeout behavior requested by the PPSA90210 client: |
f17e10b to
3d67792
Compare
|
Further update to #9834: the request path now enforces PPSA90210's configured DNS resolve timeout with a bounded host-resolver worker pool; a delayed-resolver test checks the deadline and resolver error path. The TLS loopback test now leaves the test CA untrusted and verifies that the caller's accept-certificate callback is propagated and invoked, matching StoreHttpClient's setup. After these additions, the focused x86-64 GCC 12.2/QEMU run still passes all four tests: |
e0c2a51 to
5404517
Compare
|
Rebased #9834 onto current |
From p3n1cillin's commit 16a8fb3 on boykopovar#11134. Co-authored-by: p3nicillin <lcmcclellan12@gmail.com>
From p3n1cillin's commit f5dc38b on boykopovar#11134. Co-authored-by: p3nicillin <lcmcclellan12@gmail.com>
…d check From p3n1cillin's commit 191757d on boykopovar#11134. Co-authored-by: p3nicillin <lcmcclellan12@gmail.com>
The chunk trailer bound, the public header exports and the offline-imports test fix are p3n1cillin's commits from boykopovar#11134.
…d module test libSceHttp now links libSceNet and libSceSsl, and libSceNet needs libSceNetCtl, so avplayer_http_patched_modules copies and patches all three.
|
@DoubleAAGuy I pushed onto this branch to finish the open review points: the chunk trailer section is now bounded, consumed input is dropped from the read buffer, and the transport exports use the public headers. Those three fixes are @p3n1cillin's commits from #11134, credited in each commit. I also merged main and staged libSceNet, libSceSsl and libSceNetCtl in avplayer_http_patched_modules, since libSceHttp now links them. The Linux build and the http, avplayer and public_headers tests pass locally. The PR is still a draft; mark it ready when you are happy with it, or say if you would like us to. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
MarcZX10
left a comment
There was a problem hiding this comment.
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-65adds every lookup to an unbounded queue. If concurrent calls accumulate while resolver workers are occupied ingetaddrinfo, 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
- Resolver worker count and queue storage at the reviewed head
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.
What
Implement a synchronous HTTP/1.1 request path in
libSceHttpover the existinglibSceNetandlibSceSsllibraries. Connections and requests retain their URL/method and request headers;sceHttpSendRequestsends the request and parses response status/headers, whilesceHttpReadDatastreams 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 libcgetaddrinfocannot be cancelled; late results are discarded. Connect timeouts use a nonblocking socket pluslibSceNetepoll; cross-origin redirects drop caller-suppliedAuthorization,Proxy-Authorization,Cookie, andHostheaders.The concrete caller is Prospero Themes (
PPSA90210): its StoreHttpClient loadslibSceHttpandlibSceSsland 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
libSceSslverification 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:
libc,libkernel,libSceNetCtl,libSceNet,libSceSsl,libSceHttp, and committed HTTP test targets using GCC 12.2.0 in an out-of-tree CMake harness.guest_http,guest_http_response_header,guest_http_options,guest_http_transport, andguest_http_transport_context_allocationunder QEMU x86-64 emulation; all five passed.guest_http_transportincludes 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, andRequest.cppwith-Wall -Wextra -Werrorpassed.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/AnyPS5could not run to completion because this host has Git 2.34.1 and the tool uses the newergit merge-tree --write-treeinterface. 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 intests/networking; the uncomparable #8646 offline-import hunk does not change the assertion modified here.Checklist
main; no other open PR implements the same request functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)