feat(libSceNpWebApi): return the measured errors from ReadData and the header getters #11371
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11371"
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 Terminev on 2026-10-26T09:27:25Z.
What
Follow-up to #9797, using the PS4 Pro measurements @ntamas94 posted there. Implements three libSceNpWebApi (PS4) exports that still threw:
sceNpWebApiReadData(requestId, data, size):INVALID_ARGUMENTwithout a buffer or for zero bytes, then the usual lookup (LIB_CONTEXT_NOT_FOUND,USER_CONTEXT_NOT_FOUND,REQUEST_NOT_FOUND),ABORTEDfor an aborted request, otherwise libSceHttpINVALID_ID(0x80431100).sceNpWebApiGetHttpResponseHeaderValue(requestId, fieldName, value, valueSize)andsceNpWebApiGetHttpResponseHeaderValueLength(requestId, fieldName, valueLength):INVALID_ARGUMENTfor a missing argument, the same lookup, otherwise libSceHttpPARSE_HTTP_INVALID_RESPONSE(0x80432060).No request is ever sent offline (
sceNpWebApiSendRequestreturnsNOT_SIGNED_IN), so every request that exists is unsent, and the console returned exactly these two codes for an unsent request, and0x80552904for request -1. shadPS4 returns 0 bytes fromsceNpWebApiReadDatain that case; this follows the console. The argument checks before the lookup,ABORTEDfor an aborted request and leaving the outputs unwritten follow shadPS4 and are recorded as unverified indocs/dev/debt/libSceNpWebApi.md.The two header getter placeholders in
include/Api.hppare replaced with these signatures;sceNpWebApiReadDataalready has the matching declaration #10698 added.Not in this PR:
sceNpWebApiGetHttpStatusCodewas not measured, andsceNpWebApiUtilityParseNpIdrejected every input the probe tried, so the accepted form is unknown; both still throw.Overlap: #10698, now merged, declared
sceNpWebApiReadDataandsceNpWebApiGetHttpStatusCodewith the same arguments. This PR implements the first, keeps #10698's declaration of the second, and cuts #10698's debt entry down tosceNpWebApiGetHttpStatusCode.Tested
Linux x86-64 (Intel Xeon @ 2.10GHz with AVX2, FMA, F16C, BMI1, BMI2, LZCNT and MOVBE), GCC 13.3, Release, on
a7b51a0b8based on main at801d5b9bc:ctest -R '^guest_np_web_api$'andctest -R public_headers(65/65) pass. The new test function covers every path of the three exports, including the measured rows, and checks that a failed call leaves the outputs alone. Breaking each path on purpose (a read that succeeds, an ignored abort, a zero size accepted, a missing length output accepted, a header query without the lookup) makes the test fail. SDL was configured with its XRandR and audio checks disabled locally, since that machine lacks those headers; this library and its test do not use SDL.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass. Not built on Windows. No title tested.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
https://claude.ai/code/session_01RoucYS7mQpV23WDUEwXLuU
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:32:15Z.
Review: COMMENTED
I reviewed exact head
91772d8a556c623eec2c3a194020a4668ad62ee8against currentmain4e43321bd6ceccdc1ae28568bbbc35d9a6446464. The implementation and tests are consistent with the stated offline-request behavior, and the argument/lookup uncertainties are recorded indocs/dev/debt/libSceNpWebApi.md.python3 -I tools/check_conventions.py --base upstream/main --head upstream/pr/11371andgit diff --check upstream/main...upstream/pr/11371pass. I could not runguest_np_web_api: local configuration stops because the SDL2 submodule is uninitialized, and the host has no system SDL2 package. Hosted product jobs are skipped by path policy.One integration note: an exact pairwise merge preview with open #10698 conflicts in
core/libs/prx/libSceNpWebApi/Export.cpp, where that PR also changessceNpWebApiReadDatafrom the old stub. This PR merges currentmaincleanly and does not depend on #10698, but the two branches need reconciliation so the remaining signature declarations in #10698 are preserved if this implementation lands first.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T10:49:47Z.
Review: APPROVED
Reviewed exact head 91772d8a556c623eec2c3a194020a4668ad62ee8. The request lookup/error ordering, measured unsent-response codes, aborted-read behavior, and unchanged output buffers are covered by the implementation and regression cases. The PR reports guest_np_web_api and public_headers passing at this head; hosted eligibility, conventions, intake, and labels also pass, while product jobs are skipped by path policy. I attempted a local CTest rerun, but the retained build directory has zero registered tests, so I am relying on the PR's focused run report rather than claiming an independent test pass. No correctness issue found.