fix(libSceHttp): parse empty Content-Range responses #18248
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18248"
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-11T00:04:25Z.
What
The shared host HTTP client rejects an empty source when its
416 Range Not Satisfiableresponse spells the Content-Range unit asBytes,BYTESorbYtEs, or writes the zero length as000. Opening returns failure even though these describe the same empty representation asbytes */0. The client is also used by the AvPlayer HTTP transport.Parse the unsatisfied byte-range length with the existing numeric parser and compare its unit without case sensitivity. This follows RFC 9110 section 14.1 and the unsatisfied-range grammar in section 14.4. Nonzero lengths, unknown units, malformed numbers and missing headers still fail.
Extend the existing real-server integration test with five valid forms and twelve refusal cases. It checks the empty source's size, end-relative seek and EOF without writing, the cleared state after a refused open, and reopening a nonempty source.
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. FFmpeg reused the existingffmpeg-9ac4cfd195f1package throughFFMPEG_PREBUILT_DIR; the source pin remains9ac4cfd195f192ed8b08566f49c28dbb48d08341.Base:
bc94a8e423ea026aadbb29165fed1ad2db471154. Tested fix:3cd55326910d752860725e4aa1b8d8dbd3028adb.The regression failed through the actual exported client and a loopback HTTP server with
Client.cpptaken byte-for-byte from the exact base. It reported the title-case, uppercase, mixed-case and padded-zero forms as rejected. Rebuilding the committed fix passed the same fixture.The full production libraries, relinker and affected test executables built successfully. All 74 selected CTests passed, with zero failures or skips and each test below 30 seconds. This includes the HTTP client, response-header, options and diagnostic tests; AvPlayer HTTP and transport tests; patched-module integration; all 407 patched libraries loading; and the public-header audit plus 64 compilation batches. The audit checked 407 libraries and 33,863 exports. These are synthetic integration tests; no PS5 console or title run was performed.
Commands from the source checkout, with the supported toolchain on
PATHand the local full build in../b:Conventions and whitespace checks passed. The final overlap check compared all 2,007 open pull requests and reported no overlap; it ran in a separate local clone to keep its scratch refs independent of another running check.
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-11T00:08:48Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
3cd5532691: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-11T00:12:26Z.
Review: COMMENTED
Reviewed — no blocking findings
I found no defect in this exact change; the Windows job is still pending, so this is a comment rather than an approval.
What I ran
Head
3cd55326910d752860725e4aa1b8d8dbd3028adb; base610190fce17a4022009ee323ee293b84138ae261. The exact head merged cleanly onto that base in the precheck.Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0.
I read all three changed files, checked the new CTest registration, and inspected the reported tests and current hosted checks. I did not build or run CTest locally.
Results
guest_http_clientinvokes the new test and server.Full no-build precheck results and command output
AvPlayerHttpServer.pycompiled withpy_compile.Commands and unedited output recorded by the precheck:
The precheck's heuristic warning is false:
core/libs/prx/libSceHttp/CMakeLists.txtexplicitly registersGuestHttpClient.cppasguest_http_client_testsand runs it throughAvPlayerHttpServer.py.Negative control
I did not run one. PrivacyOnion reports reverting
Client.cppto the base while keeping the new test makesguest_http_clientfail, and restoring the change makes it pass; I did not independently reproduce that result.Findings
Blocking
None found in the three changed files.
Non-blocking
None.
Sources
*/complete-lengthform.Not verified
To get this to a good state
No code change is needed based on this review. Let the pending Windows job finish; if the head changes, rerun the same no-build checks and review the new diff.