fix(libSceHttp): bound response header values as a PS5 does #5476
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5476"
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 hugodearaujo on 2026-10-13T20:46:48Z.
What
sceHttpParseResponseHeaderdisagreed with a PS5 (firmware 13.60) in three ways, measured through the console'slibSceHttp.sprxfrom a payload:Empty:\r\nSpaces: v \r\n…,mainreturnedSpaces: vas the value ofEmpty; the leading-whitespace skip consumed the line break. The console returns 0 with a null value and length 0, and does not look for a later field of the same name (E2:\r\nE2: secondis empty too).value - header + length), for example 23 forContent-Type: text/html\r\n…;mainreturned 25.X: right\ngivesright\n,X: abc\r\n\tdef\r\ngivesabc\r\n\tdef\r\n), and a bare line feed after the colon is skipped as whitespace (X:\nY: zgivesY: z), while the line feed of a CRLF is not (X:\r\nY: zis empty).The new code follows a model fitted to the console and then checked on data it had not seen:
v} afterX:, alone and followed byY: z(1,562 headers);v} (2,048);v} (6,250);guest_http_response_headertest and 16 mixed headers.The model matches all of them. It skips leading whitespace up to the line feed of a CRLF. It then ends the value at the first line feed followed by a character other than space or tab, without its carriage return when that line feed, or the value's first one, ends a CRLF; with no such line feed, at the end of the buffer.
The existing test expectations came from shadPS4 and encoded the old results (
X:\r\nnext\r\ngavenext); they now hold the console's results.Tested
sceHttpParseResponseHeader, compared with this implementation (no mismatch).guest_http_response_headerfails with this PR'sExport.cppreverted and passes with it.agc_driver_tessellationsegfaults the same way onmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:26:03Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed