Repository navigation
feat(libSceNpWebApi2): add web trace tags and abort push event handles offline - #6
Closed
KernelPanicNT wants to merge 1 commit into
Closed
KernelPanicNT wants to merge 1 commit into
KernelPanicNT wants to merge 1 commit into
Conversation
…s offline sceNpWebApi2AddWebTraceTag follows shadPS4: a null value returns INVALID_ARGUMENT and any other value is added as the X-Psn-WebTrace-Tag header through sceNpWebApi2AddHttpRequestHeader. sceNpWebApi2PushEventAbortHandle returns success for a known library context, since push event handles are not tracked and nothing waits on one offline. An unknown context throws, as in sceNpWebApi2PushEventSetHandleTimeout, because its PS5 error code is unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Withdrawn: open upstream PR boykopovar#5929 already implements the same functions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
sceNpWebApi2AddWebTraceTag(NIDMgsTa76wlEk) andsceNpWebApi2PushEventAbortHandle(NID1OLgvahaSco) on the existing offline libSceNpWebApi2 model. No other export changes behaviour.Source of the behaviour. No console measurement is involved; both calls follow shadPS4's PS4 implementation at
f47bbd5, adapted to what this library already models:sceNpWebApi2AddWebTraceTag(int64_t request_id, const char* value): shadPS4 returnsORBIS_NP_WEBAPI2_ERROR_INVALID_ARGUMENTfor a null value and otherwise adds the value as theX-Psn-WebTrace-Tagheader through its request-header path (np_web_api2.cpp L38-L45). The error is0x80553402(np_error.h L548), the value this file already returns for a null request id insceNpWebApi2CreateRequest. Here the header goes through the existingsceNpWebApi2AddHttpRequestHeader, which accepts every request id and keeps nothing, since no request reaches a server.sceNpWebApi2PushEventAbortHandle(int lib_ctx_id, int handle_id): the signature is shadPS4's (np_web_api2.cpp L229-L232); itsabortPushEventHandlelooks up the library context and the handle and marks the handle aborted. This library does not track push event handles (sceNpWebApi2PushEventCreateHandlehands out an id,sceNpWebApi2PushEventDeleteHandleaccepts any handle) and nothing waits on one offline, so for a known library context there is nothing to abort and the call returns 0. This is the model ofsceNpWebApi2PushEventSetHandleTimeout, merged in feat(exports): export the calls PPSA01317 imports boykopovar/AnyPS5#4834: the library context is checked against the contextssceNpWebApi2Initializecreated, the handle is not.Changes:
core/libs/prx/libSceNpWebApi2/Export.cpp: the two exports take their signatures and the behaviour above. The other exports are unchanged.core/libs/tests/GuestNpWebApi2.cpp:guest_np_web_api2covers a trace tag on a live request, a null value (0x80553402), abort on a live context with a handle of that context and with an unknown handle, and abort aftersceNpWebApi2Terminate, which throws.docs/dev/debt/libSceNpWebApi2.md: both entries under Unknown function info record the PS4 origin, the commit-pinned shadPS4 lines and the cases below.What stays throwing or differs, and why:
sceNpWebApi2PushEventAbortHandleon an unknown library context throwsstd::invalid_argument, assceNpWebApi2PushEventSetHandleTimeoutandsceNpWebApi2GetMemoryPoolStatsdo: shadPS4 returnsLIB_CONTEXT_NOT_FOUND(0x80553404) there, but that is PS4 numbering and the PS5 result is unverified.HANDLE_NOT_FOUND(0x8055340d): handles are not tracked here, and tracking them would change whatCreateHandle,DeleteHandleandCreateFilterreturn for every title. The debt entry states this.Progress: libSceNpWebApi2 27/29 → 29/29; system libraries 3249/3678 (88.34%) → 3251/3678 (88.39%) by
tools/progress.pyon the branch basecaee23f.Tested
Head
bec511d872b11fb9ef3763b8f3dfa504d6ccb541, base84b01f9cd042e1d2e9e112f8783aa5a9d26399ee.BUILD_TESTING=ON, tests run under QEMU 8.2 user mode with-cpu EPYC-Romebecause the build host lacks AVX2):guest_np_web_api2_tests5/5 passes.core/libs/prx/libSceNpWebApi2/Export.cppwith the base version:guest_np_web_api2_testsfails withsceNpWebApi2PushEventAbortHandle not implemented. Restoring the PR source and rebuilding passesguest_np_web_api2_tests5/5.git diff --checkpass. The Linux job of the Build workflow now targets the project's self-hosted runner, so it was not run on the fork; no title was run.Duplicate and overlap check
Checked the files of all 443 open PRs on 2026-10-14 and searched open, merged and closed PRs for both function names and the NID
1OLgvahaSco. No open PR toucheslibSceNpWebApi2/Export.cpp,GuestNpWebApi2.cppordocs/dev/debt/libSceNpWebApi2.md, and none names either function.History of the same exports:
sceNpWebApi2AddWebTraceTagas a throwing stub; fix(npwebapi2): export sceNpWebApi2AddWebTraceTag as a no-op boykopovar/AnyPS5#4178, which exported it as a no-op without a source, was closed as its duplicate. This PR replaces the stub with the shadPS4 behaviour above.sceNpWebApi2PushEventAbortHandleas a throwing stub. feat(libSceNpWebApi2): implement sceNpWebApi2PushEventAbortHandle boykopovar/AnyPS5#4375, feat(libSceNpWebApi2): implement push event abort handles boykopovar/AnyPS5#4188, feat(libSceNpWebApi2): implement sceNpWebApi2PushEventAbortHandle boykopovar/AnyPS5#4668 and feat(libSceNpWebApi2): implement push-event handle abort boykopovar/AnyPS5#5085 carried a handle-tracking implementation and were closed: it changed whatCreateHandle,DeleteHandleandCreateFilterreturn for every title, from PS4 codes, and no title was shown stopping at the export onmain. This PR leaves those three exports as they are; it does not supply a title stop either (Unblocks is none).The branch is one commit on
caee23f; none of the newer commits onmain(84b01f9) touch these files, and it merges without conflicts.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)