AnyPS5/docs/dev/debt/libSceHttp2.md

3.7 KiB

libSceHttp2 technical debt

Silent stubs

  • libSceHttp2 - no request reaches the network, so sceHttp2SetMinSslVersion has no TLS connection to restrict and its value is ignored, as for sceHttp2SslEnableOption and sceHttp2SslDisableOption. The three setters validate id against the live handle registry and return SCE_HTTP2_ERROR_INVALID_ID (0x817B1100) for a handle that was never allocated, was deleted, or belonged to a terminated context, following prosper. Whether the console restricts the object kind these setters accept, and what it does with an id from a previous init/term cycle, is unverified, so any live handle kind is accepted and ids are never reused. sceHttp2Term, sceHttp2DeleteTemplate, sceHttp2DeleteRequest, sceHttp2CreateTemplate, sceHttp2CreateRequestWithURL, sceHttp2CreateCookieBox and sceHttp2SendRequestAsync also return the invalid-id error for a handle of the wrong kind or no longer live, following prosper (not measured on a console)

Unknown function info

  • sceHttp2WebSocketSetPingInterval (libSceHttp2, NID YfaXPnc8PJE) - imported by libdiscord_partner_sdk.prx of PPSA23126 (issue 2648). The parameters, the unit of the interval and the console errors are unknown. Every call throws.
  • sceHttp2DeleteCookieBox (libSceHttp2) - imported by PPSA35943's Unity player. The (int cookieBoxId) signature follows SharpProspero. A box sceHttp2CreateCookieBox returned is discarded; an unknown or already deleted id returns the library's invalid-id error (0x817B1100), as prosper does; not measured on a console
  • sceHttp2SetResolveRetry (libSceHttp2) - signature (int id, int32_t retry) from libSceHttp's sceHttpSetResolveRetry; the value is accepted and ignored like the other Http2 settings, since no request reaches the network
  • sceHttp2WebSocketCreateRequest, sceHttp2WebSocketCloseAsync, sceHttp2WebSocketSendTextMessageAsync, sceHttp2WebSocketSendDataMessageAsync (libSceHttp2) - imported by PPSA16064 and not called during its start-up; unknown signatures
  • libSceHttp2 cookie boxes (libSceHttp2) - sceHttp2CreateCookieBox is taken to take the library context id first, as in the prosper reimplementation; further arguments are unknown and ignored. sceHttp2SetRequestNoContentLength is assumed to take only the request id. Cookies are never stored, so sceHttp2CookieFlush has nothing to discard

Functional

  • libSceHttp2 asynchronous requests (libSceHttp2) never reach the network: sceHttp2SendRequestAsync accepts the request, queues a completion whose result is the library's network error and triggers the user event named by the kqueue option (equeue at offset 0, event id at 8, user data at 16, layout inferred from PPSA17221); sceHttp2WaitAsync returns that completion. The completion's event_type value is unknown and left 0. PPSA17221 completes its request object only after sceHttp2SendRequestAsync returns, and its handler for a synchronous failure calls shared_from_this before that, so a send must not fail synchronously. A kqueue option or user event that is missing, an extra option, and a wait with no completed operation throw