AnyPS5/docs/dev/debt/libSceHttp.md

8.5 KiB

libSceHttp technical debt

Silent stubs

  • libSceHttp - no request reaches the network, so sceHttpSetResponseHeaderMaxSize has no response header to limit, sceHttpSetRecvBlockSize ((int id, u32 blockSize) as in shadPS4) no response body to read in blocks and sceHttpRedirectCacheFlush no redirect to forget; sceHttpsUnloadCert returns success like sceHttpsLoadCert, which keeps no certificate; sceHttpSetRedirectCallback and sceHttpSetCookieRecvCallback accept callbacks that are never called, sceHttpsSetSslVersion has no TLS connection to configure and sceHttpsGetSslError reports error 0 with detail 0; sceHttpSetAuthInfoCallback accepts a callback that is never called, as no server asks for authentication; sceHttpsGetCaList and sceHttpsFreeCaList report an empty CA list (certs null, certsNum 0) and return 0, as no CA store is kept, and a null list returns ERROR_INVALID_VALUE; unlike shadPS4 they do not check that http_ctx_id is a live context nor that the library is initialised, and sceHttpsFreeCaList also nulls certs, which shadPS4 leaves untouched. The signatures and the { void* certs; int certsNum; } layout follow shadPS4 (PS4), not confirmed on a PS5 title

Unknown function info

  • sceHttpUriBuild (libSceHttp) retains // for a non-opaque URI independently of the selected fields, following shadPS4. Black Myth: Wukong builds its Scheme header with option 1 and expects http:// or https://. Other partial field combinations follow the PS4 reference and remain unverified on PS5 hardware.
  • sceHttpSetCookieEnabled - the two-argument signature and 0/1 enable values follow VitaSDK and shadPS4; PPSA01521 passes 0 to disable cookies. Disabling succeeds because the offline HTTP backend has no cookie engine; enabling throws. Invalid enable values use the same error as sceHttpSetInflateGZIPEnabled. Like the existing offline HTTP setters, the handle is not validated; requests still fail with the network error. Console behavior is unverified
  • sceHttpParseResponseHeader (libSceHttp) - signature follows SharpProspero; parsing and error codes follow shadPS4's reverse-engineered PS4 library, not confirmed on a PS5 title or hardware. Folded values retain their line breaks and whitespace; an empty first line starts the value scan after its line feed. A consumed byte count above INT_MAX throws instead of wrapping.
  • sceHttpParseStatusLine (libSceHttp) - behaviour and error codes follow the shadPS4 reimplementation of the PS4 library, not confirmed on a PS5 title; unlike it, no byte past lineLen is read
  • sceHttpUriMerge (libSceHttp) - signature follows SharpProspero; validation, size formula, absolute/relative split and path join follow the disassembly-like body in shadPS4, not confirmed on a PS5 title or hardware. The base URL goes through our sceHttpUriParse, which removes dot segments from the base path, while the relative part is appended unswept; base query and fragment are dropped. The relative reference is only classified by its scheme and a leading //, and only references with // are validated; as in shadPS4, //host/x is returned unchanged instead of taking the base scheme, a reference with a scheme but no // (mailto:x) is joined onto the base directory, and ?q and #f are appended to the base directory instead of the base path.
  • sceHttpUriUnescape (libSceHttp) - signature follows SharpProspero; percent decoding, invalid sequences and error codes follow shadPS4, not confirmed on a PS5 title or hardware. Size includes the final NUL; malformed escapes and + remain unchanged, and decoding runs once.
  • sceHttpUriSweepPath (libSceHttp) - behaviour follows the shadPS4 reimplementation of the PS4 library and its tests (including the PS4 SDK example), not confirmed on a PS5 title or hardware. It is not RFC 3986 5.2.4: a path that doesn't start with / is copied unchanged and a trailing . or .. without a slash is kept. Unlike shadPS4, nothing at or past srcSize - 1 is read, and srcSize == 1 writes only the terminator
  • sceHttpSetResponseHeaderMaxSize, sceHttpRedirectCacheFlush, sceHttpsUnloadCert (libSceHttp) - signatures follow shadPS4 (PS4); no PS5 reference has them
  • sceHttpSetRequestStatusCallback - the three-argument ABI follows shadPS4. Registrations and user data are retained and removed on request deletion; the offline backend never dispatches callbacks. Invalid ids return 0x80431100, an uncited assumption, not a verified console error. Handle hierarchy, inheritance and deleted-handle validation remain incomplete; callback statuses and dispatch timing are unknown.
  • sceHttpSetRedirectCallback, sceHttpSetCookieRecvCallback, sceHttpsSetSslVersion, sceHttpsGetSslError (libSceHttp) - signatures follow shadPS4 (PS4), which only logs and returns 0; a null errNum or detail in sceHttpsGetSslError is assumed to return SCE_HTTP_ERROR_INVALID_VALUE like sceHttpGetLastErrno
  • sceHttpSetAuthInfoCallback (libSceHttp) - signature and callback type follow shadPS4 (PS4); no PS5 reference has them. The id is not checked, as in the other libSceHttp setters
  • sceHttpWaitRequest (libSceHttp) - the timeout is assumed to be in microseconds and a negative timeout to wait without limit; the invalid-value error for a null handle or event array or a non-positive event count is assumed, not measured. No request is ever pending, so a wait returns 0 events when its timeout passes

Functional

  • sceHttpAbortWaitRequest, sceHttpWaitRequest (libSceHttp) - the abort takes only the epoll handle, as in Orbital and SharpProspero; behaviour and error codes follow shadPS4 (PS4), not confirmed on a PS5 title or hardware. An abort stays set: every later wait on the handle, a poll included, returns SCE_HTTP_ERROR_ABORTED (0x80431080) until the handle is destroyed. A wait woken by sceHttpDestroyEpoll, or by the sceHttpTerm that ends the last context, returns 0 events. The epoll calls return BEFORE_INIT (0x80431001) while no sceHttpInit context is alive and INVALID_ID (0x80431100) for an unknown context or handle, and sceHttpTerm returns the same errors instead of succeeding for any id. Handles are pointers, so a stale handle whose address a newer epoll reuses is taken as that epoll