libs: implement sceHttp2AbortRequest (Carmen Sandiego, Hot Wheels) #2139
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2139
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2139"
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?
@QW1CKS on GitHub · 2026-11-06 16:53 UTC · original
QW1CKS:libs/http2-abort-request→main· +285 −17 · 3 files · 3 commits · openSummary
Carmen Sandiego (PPSA25256) and Hot Wheels Infinite Rush (PPSA22408) both stop at the logo with
IZ-qjhRqvjk[Http2_v1][Http2_v1.1]unresolved:#1960 comment and
#1960 comment.
The NID is
sceHttp2AbortRequest, which shadPS4 maps tosceHttpAbortRequest.Http2_v1.1already exported the other 31 calls of the library, includingSendRequest,DeleteRequestandWaitAsync, so a title that cancels a requesthad nowhere to go.
Cause
InitNet_1_Http2insrc/libs/libNet.cppregisters 31 functions and has no entryfor
IZ-qjhRqvjk. Requests in this library stop atHttp2SendRequest, whichreturns
HTTP2_ERROR_TIMEOUTwithout opening a connection, so there is noin-flight transfer for an abort to stop.
Change
src/libs/libNet.cpp: newHttp2AbortRequest(), registered againstIZ-qjhRqvjkinInitNet_1_Http2. An id that is not ing_http2_requestsreturns
HTTP2_ERROR_INVALID_ID(0x817B1100); a known id returns 0.A request that has not reached the send step is marked aborted, and both
Http2SendRequestandHttp2SendRequestAsyncthen report the result it alreadycarries instead of overwriting it with
HTTP2_ERROR_TIMEOUT. That follows thereference: shadPS4's
sceHttpAbortRequestmoves aCreatedorSendingrequestto
Aborted, its send returnsORBIS_HTTP_ERROR_ABORTEDfor it, and itssceHttp2AbortRequestforwards to it without removing the entry. The request isleft in the map as well, so
Http2DeleteRequestis still the call that frees itand a later
Http2SetRequestContentLengthon the same id still finds it.The console's own code for the post-abort send is not published anywhere I could
check: shadPS4 uses the HTTP-layer
0x80431080, and AnyPS5 records thelibSceHttp2 mapping as unknown, so the request keeps
HTTP2_ERROR_BEFORE_SENDrather than a guessed value. A request that already reached the send step keeps
its result.
Tests
New
tests/Http2AbortRequestTests.cpp, registered ashttp2_abort_requestinCMakeLists.txtand added tokyty_tests. It walks the export table the wayHttpUriParseTestsdoes: the NID resolves to a function, an id that was neverhanded out returns
HTTP2_ERROR_INVALID_ID, and a real request created throughHttp2Init/Http2CreateTemplate/Http2CreateRequestWithURLreturns 0 onabort and is still reachable afterwards. An unsent request that was aborted keeps
its pre-send result through both send paths, the async path clears the event type
a completed read leaves behind and still fires the caller's user event on a
registered queue, and an abort after the send step leaves the result alone.
Ubuntu 24.04.5, clang 18.1.3,
_Build/linux-no-qt(-DKYTY_BUILD_LAUNCHER=OFF),origin/mainat182161eb.LIB_FUNC("IZ-qjhRqvjk", ...)removed the test exits 1 onsymbols.FindByNid("IZ-qjhRqvjk", Loader::SymbolType::Func) != nullptr.send(req_id, nullptr, 0) == kHttp2ErrorBeforeSend, on the same check throughHttp2GetResponseContentLength, and onresult.result == kHttp2ErrorBeforeSendin the async case.
ctest -R '^(http2_abort_request|http_uri_parse|bit_array|build_flags|archive_file)$'passes 5/5.
pre-commit run --from-ref origin/main --to-ref HEADpasses. clang-format22.1.3 also reformatted 39 pre-existing lines of
src/libs/libNet.cppin 11hunks: that file did not satisfy the hook on
main. The lines this PR adds areunchanged by the formatter.
I could not run either game, so I cannot say whether this alone gets them past the
logo. The Hot Wheels log also lists four other unresolved imports besides this
one, and there are no game files or PS5 hardware on this machine.
Related
The other NIDs from the Hot Wheels log are not part of this PR:
-PoIzr3PEk0(sceSslGetMemoryPoolStats) is still unregistered, andotUQuZa-mv0/Gcjh+CisAZM/rMyh97BU5pYwere implemented inc5d6206aand3c72b346. #1960 stays open as the aggregation thread.AI use: drafted with AI assistance (Claude Code for the first commit, GitHub
Copilot for the follow-ups); verified and tested by me.
@coderabbitai[bot] on GitHub · 2026-11-06 16:58 UTC · original · edited 2026-11-06 17:34 UTC
Walkthrough
The change adds and exports
Http2AbortRequest. It returnsHTTP2_ERROR_INVALID_IDfor unknown request IDs and marks a request aborted only before its send step. Synchronous and asynchronous sends handle aborted requests using the existing send result. New tests cover unknown IDs and request behavior before and after send. CMake builds and registers the test executable.Suggested reviewers:
nmzikChange: Feature
Merge Risk:
Minimal · up to
86e89The abort implementation and its tests present no established merge-blocking issue; normal validation remains appropriate.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 14 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@ -1507,0 +1539,4 @@request->second.aborted = true;}return 0;@coderabbitai[bot] on GitHub · 2026-11-06 16:58 UTC · original · edited 2026-11-06 17:25 UTC
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 26790
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 24096
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9251
Web query:
PlayStation sceHttp2AbortRequest before sending request sceHttp2SendRequest aborted error behavior documentationResult:
Preserve the aborted state for unsent requests.
When
Http2AbortRequestsucceeds for a request whosesend_resultisHTTP2_ERROR_BEFORE_SEND, mark it asHTTP2_ERROR_ABORTED. WhenHttp2SendRequestsees that result, return it instead of overwriting it withHTTP2_ERROR_TIMEOUT. Do not change the result for requests that were already sent.Suggested fix
✅ Confirmed as addressed by @QW1CKS
@coderabbitai[bot] on GitHub · 2026-11-06 16:58 UTC · original · reviewed
Actionable comments posted: 1
83bf20ea-2190-422b-be3d-196ca6301005Reviewing files that changed from the base of the PR and between
182161eb3eand4e97990af7.CMakeLists.txtsrc/libs/libNet.cpptests/Http2AbortRequestTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-11-06 17:23 UTC · original · reviewed
481051de-b338-484b-b7c7-939109269c0eReviewing files that changed from the base of the PR and between
4e97990af7and0fa7493195.src/libs/libNet.cpptests/Http2AbortRequestTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@ -1507,0 +1539,4 @@request->second.aborted = true;}return 0;@QW1CKS on GitHub · 2026-11-06 17:25 UTC · original
Fixed in
0fa74931. The request records the abort, and both send paths now return the result it already carries instead of overwriting it with a timeout. Requests that already reached the send step keep theirs.I kept HTTP2_ERROR_BEFORE_SEND instead of adding 0x817B1080, because that value is not published anywhere I could check: shadPS4 returns the HTTP-layer 0x80431080 for a send after an abort, and AnyPS5 records the libSceHttp2 mapping as unknown. Tests cover the sync and async paths and the after-send case; red on the old code, green now, ctest 5/5 and pre-commit clean.
@ -1507,0 +1539,4 @@request->second.aborted = true;}return 0;@coderabbitai[bot] on GitHub · 2026-11-06 17:25 UTC · original
@QW1CKS Thank you for the fix. The supplied code records the abort and preserves the existing result in both send paths. It leaves the result unchanged if the request already reached the send step.
My suggested
0x817B1080value was not supported by the evidence. The console’s result for this case remains unverified.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
Review thread resolved.
You are interacting with an AI system.
@coderabbitai[bot] on GitHub · 2026-11-06 17:34 UTC · original · reviewed
27a3cb3c-f8ad-43cf-965f-7d368c169f20Reviewing files that changed from the base of the PR and between
0fa7493195and86e89b254d.tests/Http2AbortRequestTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.