Skip to content

fix(libSceHttp2): complete sceHttp2SendRequestAsync offline instead of throwing - #41

Merged
AlxcBTW merged 1 commit into
mainfrom
fix/http2-async
Oct 28, 2026
Merged

AlxcBTW merged 1 commit into
mainfrom
fix/http2-async

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What

The nightly built from main after the upstream sync (#34) aborts a title about 7 seconds after boot: sceHttp2SendRequestAsync throws "not implemented" (SIGABRT). Upstream removed the offline completion when it added its synchronous HTTP/2 transport, so the async send, sceHttp2WaitAsync and sceHttp2ReadDataAsync now throw. The fork's pre-#34 code (f05284d) answered with the library's network error and the title carried on. Any title that submits requests asynchronously dies, not one game.

This restores that behaviour and nothing more (no request reaches the network on this path):

  • sceHttp2SendRequestAsync queues one completion (req_id, result 0x80436063, the library's network error), triggers the user event of the kqueue option and returns 0. Unchanged from pre-chore(sync): merge upstream boykopovar/AnyPS5 up to ca0e955 #34: an unknown request id answers the invalid-id error, and an extra option or a failed event trigger still throw.
  • sceHttp2WaitAsync returns the queued completion; it throws when nothing is queued.
  • sceHttp2ReadDataAsync returns the network error.
  • A request that failed this way answers sceHttp2GetStatusCode, sceHttp2ReadData and sceHttp2GetResponseContentLength with the network error instead of throwing "has not been sent". A request that was never submitted still throws as upstream's tests expect.
  • The completions live in the request's handle, so deleting the request, its template or the context drops them (no second registry or mutex).

Overlap with #33 (@hypermoist, T52): #33 rewrites these same functions to transmit over mbedTLS and queue the real result, and removes this debt entry. That is the real fix; this is the minimum that stops the abort until it lands. I did not complete the async request through the synchronous transport: a send on the caller's thread would block a game thread on the network for seconds, and doing it on a worker needs the teardown rules #33 is already defining. When #33 merges, take its version of Export.cpp and GuestHttp2.cpp for these functions; the conflict is those hunks only.

core/libs/tests/GuestHttp2.cpp had asserted that the async calls throw (upstream's test); it now checks the return values, the event, the completion, the follow-up calls and the invalid and deleted ids, on a separate request so the existing "unsent request throws" checks stay.

Tested

Syntax-checked Export.cpp and GuestHttp2.cpp with g++ (-fsyntax-only). The C++ tree is not built locally; the dispatched build runs guest_http2.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@AlxcBTW
AlxcBTW merged commit 323c1d6 into main Oct 28, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant