feat(libSceHttp2): store cookies in cookie boxes #10534
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10534"
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 noamroger on 2026-10-24T08:47:17Z.
What
Gives the cookie boxes
sceHttp2CreateCookieBoxalready creates a real cookie store, in a newCookies.cppso it stays out of the transport work inExport.cpp:sceHttp2AddCookie,sceHttp2GetCookie,sceHttp2GetCookieStats,sceHttp2SetCookieMaxNum,sceHttp2SetCookieMaxNumPerDomainandsceHttp2SetCookieMaxSize, with signatures from SharpProspero'sHttp2.cs, declared ininclude/Http2.hpp.libSceHttp2.sprx(thanks to the reviewer who ran it): error codes, the no-match error,required= header length + 3, no scheme check, refused foreignDomain, cookies without=, prefix/suffix matching, the 4096/50 default limits, oldest-first eviction, a limit of 0, and the 32-byte stats with their size accounting. Expiry keeps the RFC 6265 date algorithm, which matched every tested date.sceHttp2CreateCookieBoxmaps its pool from flexible memory as 13.42 does and returns the kernel's error unchanged.sceHttp2CookieFlushempties a box andsceHttp2DeleteCookieBoxdrops its cookies.sceHttp2GetCookieBox/SetCookieBoxare untouched (#10167 changes them).What is still assumed (default total limit, the bytes after the header, the stack check that is not reproduced) is listed in
docs/dev/debt/libSceHttp2.md.Tested
GuestHttp2Cookies.cpp(registered asguest_http2_cookies) passes plain and under ASan/UBSan, built by hand against Export.cpp and Cookies.cpp with the kernel's flexible-memory calls stubbed.tools/check_conventions.py --base origin/mainpasses.9bcdf99c59) was built and passed 3 of 3 runs by a reviewer; the current head has not been rerun there.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)Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:08:08Z.
Review: CHANGES_REQUESTED
The oversized-pool guard throws
std::overflow_errorfrom this guest-facingextern "C"API. A guest can reach this path with apoolSizeaboveSIZE_MAX - 0x3fff, so the overflow is converted into a C++ exception crossing the ABI boundary (or terminating the process if it is not caught). Please return the project/API error code for an invalid or unrepresentable pool size instead, and add a regression that passes a near-SIZE_MAXvalue and verifies a normal error return without allocation or exception escape. The ordinary cookie tests and PR checks do not exercise this input.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T12:24:49Z.
Review: DISMISSED
The current head addresses the reported oversized-pool path: rounding overflow and failed array allocation now return the out-of-memory code, and tests cover near-SIZE_MAX inputs. The focused ASan/UBSan run is author-reported; hosted structural checks pass, while product builds are skipped. Please resolve the remaining direct overlap before merge: #10167 changes sceHttp2CookieFlush, sceHttp2CreateCookieBox and sceHttp2DeleteCookieBox in the same Export.cpp, while this PR implements those functions against its cookie store. The current #10167 version makes CookieFlush throw and changes the Create/Delete handle operations, so the behavior cannot be combined by a simple file rebase. Coordinate with its author on an order and the intended composed behavior, then record the dependency/order in this PR. Also coordinate the shared CMake/test relocation with #6044 so GuestHttp2Cookies and its registration are preserved.