Repository navigation
feat(libSceHttp2): implement request option getters, header removal a… - #10536
Conversation
Progress report (e61a7c7 → bffc7ed)📈 System libraries: 51.46% (+0.03%, +4 implemented functions) ✅ 4 implemented
⚪ 1 behaviourally empty (constant return or throw)
Changed libraries (implemented exports)
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
This overlaps #10167 in core/libs/prx/libSceHttp2/Export.cpp, and #10167 is an open transport rewrite that replaces this file. The repository contribution rules require authors of overlapping PRs to agree on order and record the prerequisite with Depends on. The checklist currently says Depends on: none, and the PR description only notes the textual conflict. Please coordinate with #10167’s author and update the dependency/order in the checklist before merge; otherwise the combined result has not been reviewed or validated.
|
I checked these calls against the libSceHttp2 module from PS5 firmware 13.42 (run in an emulator from the module's init through the real Matches the PR
Differs from the PR
I didn't check what the flags, headers or callbacks do once a request is sent. |
e18e4c6 to
21cd89f
Compare
|
Thanks a lot for checking against the 13.42 module. All six differences are fixed in the latest push: option, header and callback calls accept only templates and requests; RedirectCacheFlush ignores its argument; RemoveRequestHeader returns 0x817B1025 for a missing or null name (checked first); AddRequestHeader checks the mode, then Connection, then the id, removes before the null check in mode 0, and returns 0x817B11FE / 0x804311FE as measured; GetAutoRedirect returns 0x817B11FE for a null pointer and stores the int unchanged. The one deviation is a null pointer to GetAuthEnabled, which throws instead of writing through it; it’s recorded in the debt file with a link to your review. |
|
Tested head
AI-assisted: yes (Claude Code); results above were run on this machine. |
|
Thanks for the Windows run and the negative control! |
adriadam10
left a comment
There was a problem hiding this comment.
#10167 has merged and this PR now conflicts with main in CMakeLists.txt, Export.cpp, Http2.hpp and docs/dev/debt/libSceHttp2.md. The textual conflicts are the smaller part; the design needs an author decision:
Http2::Settings(Transport.hpp) already storesheaders,authandredirect, andHttp2::AddHeaderandUpdate()inExport.cppalready implementsceHttp2AddRequestHeader,sceHttp2SetAuthEnabledandsceHttp2SetAutoRedirect. The newauthEnabled,autoRedirectandheadersfields onHttp2Handleduplicate that state, and the template-to-request copy is already done throughhandle.settings = parent->settingsinsceHttp2CreateRequestWithURL.- The semantics you measured on 13.42 differ from what
mainnow does: setters accept any int for redirect (mainthrows unless it is 0 or 1), mode/Connection/id check order and error codes, andRemove/Geton kinds other than templates and requests. Please move the measured behaviour intoUpdate()andHttp2::AddHeader, and implementsceHttp2RemoveRequestHeader,sceHttp2GetAuthEnabledandsceHttp2GetAutoRedirectonSettings, keeping the rule that settings are immutable oncetransportexists (Update()currently throws then; decide what the getters and Remove do in that case). - Keep the auth-info and pre-send callbacks in
Settingsso they are copied with the rest. Say in the debt file that the transport never calls them, and state which of the two now-merged debt entries ("TLS settings", "transport") they extend. - Rebase onto
main, keepguest_http2_cookies,guest_http2_transportandguest_http2_early_responseinCMakeLists.txtnext toguest_http2_options, and extend theguest_http2_optionstest to cover a request created after a template change and the immutable-after-send case. - Update the "pending exports" count in the debt file (12 on
mainnow, minus the seven you implement).
Thanks to BunnyFl and wachi35676 for the 13.42 and Windows runs; their results still apply once the code sits on Settings.
…nd callbacks Keep the auth and auto-redirect flags, headers and the auth-info and pre-send callbacks in Http2::Settings, so requests copy them from their template and they freeze once transport exists. Accepted kinds, error codes and their order follow the firmware 13.42 module as reported in the review: option, header and callback calls reject contexts and cookie boxes, sceHttp2AuthCacheFlush validates the context, sceHttp2RedirectCacheFlush ignores its argument and the auto-redirect flag keeps the stored int. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QdXm6rjuENJGYLZh5hc8cQ
21cd89f to
bffc7ed
Compare
|
Thanks, done in bffc7ed, rebased onto main. All state is in |
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked the re-review points against bffc7ed: auth, redirect, headers and both callbacks now live in |
Old: "automatic redirects throw, so there is no redirect cache to flush" New: "redirects are followed without a cache, so there is nothing to flush" Evidence: - core/libs/prx/libSceHttp2/Transport.cpp:947-1023 loops over 301, 302, 303, 307 and 308 responses, calls the redirect callback and stops after six redirects. - core/libs/prx/libSceHttp2/Transport.hpp:33 has `int redirect = 1;`, so following is the default. - core/libs/prx/libSceHttp2/Export.cpp:465-468 sceHttp2RedirectCacheFlush still returns 0 without a cache, so the rest of the entry is unchanged. - bffc7ed (boykopovar#10536) wrote the old clause while the transport rejected redirects. 59bc5a8 (boykopovar#11586) made the transport follow them and removed the matching transport entry but missed this line.
What
Implements seven pending libSceHttp2 exports on top of the merged transport:
sceHttp2RemoveRequestHeader,sceHttp2GetAuthEnabled,sceHttp2GetAutoRedirect,sceHttp2AuthCacheFlush,sceHttp2RedirectCacheFlush,sceHttp2SetAuthInfoCallbackandsceHttp2SetPreSendCallback.Http2::Settings:redirectbecomes anint(the stored value is read back unchanged), and the auth-info and pre-send callbacks are added there, sosceHttp2CreateRequestWithURLcopies them with the rest and they freeze once transport exists. The transport never calls them.Update()can now return the invalid-id error for contexts and cookie boxes, and propagate an error from its update; the option, header and callback calls use that. Other setters keep throwing for those kinds.Http2::AddHeaderreturns0x817B11FEfor a null name or value (after removing the name in mode 0);sceHttp2AddRequestHeaderchecks the mode and thenConnection(0x804311FE) before the id.sceHttp2RemoveRequestHeaderreturns0x817B1025for a null or missing name; the getters read the settings even after send;sceHttp2AuthCacheFlushvalidates the context;sceHttp2RedirectCacheFlushignores its argument (listed under Silent stubs).sceHttp2GetAuthEnabled, which throws instead of writing through it. The pending-export count in the debt file drops from 12 to 5.Tested
Linux (Ubuntu, GCC), full build:
ctest --test-dir build -R guest_http2passes (guest_http2,guest_http2_cookies,guest_http2_options,guest_http2_transport,guest_http2_early_response).guest_http2_optionscovers a request created after a template change and the immutable-after-send case.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pycannot run in my environment; open PRs touching libSceHttp2 were checked by hand (#9598, #11145 and #11470 already conflict withmain, and none implements these exports).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