feat(libSceHttp): accept equivalent Content-Length lists #18292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18292"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-11-11T04:06:35Z.
What
Add the optional recovery for repeated decimal Content-Length values described in RFC 9110 section 8.6 and RFC 9112 section 6.3. A response such as
Content-Length: 42, 42currently fails the reusable HTTP source's single-number parser, even when every member specifies the same body length.Parse each comma-separated member with the existing strict unsigned-decimal parser, trim optional spaces/tabs, and require every numeric value to match before reading the body. This also handles leading zeroes. Conflicting lengths, empty members, signs, suffixes and overflowing values fail through the existing request-failure path. Other numeric fields retain their existing parser.
Extend the real loopback HTTP fixture with complete responses, partial range responses and empty responses. The client verifies size, payload bytes, seeking and EOF for six accepted forms in each response mode, and rejects thirteen malformed/conflicting forms in each mode. Existing range validation, representation identity, fallback, framing, redirects and cancellation checks still run.
Tested
Windows 11 Pro 26300, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON,ANYPS5_RELINKER_ONLY=OFF,ANYPS5_ENABLE_SPIRV_TOOLS=ON. CPU: AMD Ryzen 9 7900X. RAM: 31.66 GiB usable. GPU: NVIDIA GeForce RTX 4070 Ti SUPER; the selected tests do not exercise it.Upstream base:
bb520eba294d933d5d08e9abb3a6235edac41cdf. Tested head:e8b8026a8d2846b8535ff207b7b13033da43e958.Before editing production code, the new loopback cases failed on that exact base. Only the three single-value controls opened successfully. All invalid cases were already refused. The staged Windows runtime matched the rebuilt provider in both runs.
The final head rebuilt the full production libraries, relinker and selected executables successfully. All ten selected CTests passed, zero failed or skipped, each below 30 seconds: the reusable HTTP client, HTTP APIs/options/diagnostics/response headers, AvPlayer HTTP source and transport, patched HTTP/AvPlayer module integration, patched-library loading and the public-header audit. The 18/18 accepted and 39/39 refused matrix also passed through the patched-module runner. All 407 patched libraries loaded; the audit checked 407 libraries and 33,863 exports. After the composition check, the exact standalone head was restored, rebuilt and passed the same ten tests.
A local, uncommitted composition with #18248 (
3cd55326910d752860725e4aa1b8d8dbd3028adb) and #18270 (57452d7cc5c710e39044369c9d785b24a0be0885) merged cleanly, produced treeacd844c1500828ee6ef93a843ae3d8c0e709f8ae, and passed both client modes, including the 203 representation matrix, empty Content-Range cases and the new length-list matrix. The standalone head was restored afterward. No console or title run was performed; this is host HTTP interoperability, with no title-unblock or performance claim.Commands from the source checkout, with the supported toolchain on
PATHand the local full build in../b:Conventions, whitespace and fixture Python syntax checks passed. The overlap tool checked 2,021 open PRs, compared both related HTTP PRs successfully, and exited 0 with no overlap. Their combined runtime result is above; no ordering dependency was found.
Checklist
main; no other open PR implements the same 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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T04:10:38Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
e8b8026a8d:tools/check_conventions.pypassed;git diff --checkclean.guest_http_client_testsbuilt cleanly.guest_http_client):core/libs/prx/libSceHttp/src/Client.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T19:15:16Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Static reading only. No build, test or CTest run was done here.
e8b8026a8d2846b8535ff207b7b13033da43e958, basemain.Commands
Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceHttp/src/Client.cpp:60:ContentLengthtrims spaces and tabs for every value, so a single value with surrounding whitespace is now accepted too. The description implies this, but no fixture case covers it; thesinglecase atcore/libs/tests/AvPlayerHttpServer.py:368has no whitespace. A case with" \t{n}\t "would pin the behaviour.Sources
github.com/boykopovar/AnyPS5@e8b8026a8d/core/libs/prx/libSceHttp/src/Client.cpp (L53-L70)and #L459github.com/boykopovar/AnyPS5@e8b8026a8d/core/libs/tests/GuestHttpClient.cpp (L304-L338)Not verified
Field()incore/libs/prx/libSceHttp/src/Client.cpp(line 102) was not read, so I have not checked how header values are trimmed beforeContentLengthsees them.If-Rangeassertion in the fixture depends on the client sendingIf-Range. Not traced.To get this to a good state
Nothing is required. The whitespace case in the non-blocking finding is optional.