Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/libs/prx/libSceHttp/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,9 @@ int APS5_VABI sceHttpGetCookieEnabled(int id, int* enable) {
}

int APS5_VABI sceHttpSetCookieSendCallback(std::int32_t id, HttpCookieSendCallback callback, void* userArg) {
NotImplemented_nid_no_patch(__func__);
(void)id;
(void)callback;
(void)userArg;
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions core/libs/tests/GuestHttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ int main(int argc, char** argv) {
Require(sceHttpsSetSslVersion(1, 0) == 0);
Require(sceHttpSetRedirectCallback(1, nullptr, nullptr) == 0);
Require(sceHttpSetCookieRecvCallback(1, nullptr, nullptr) == 0);
Require(sceHttpSetCookieSendCallback(1, nullptr, nullptr) == 0);
int sslError = -1;
std::uint32_t sslDetail = 0xFFFFFFFFu;
Require(sceHttpsGetSslError(1, &sslError, &sslDetail) == 0);
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/debt/libSceHttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Sony guest HTTP requests still do not reach the network. The separate `Aps5HttpC
- [sceHttpUriSweepPath](../../../core/libs/prx/libSceHttp/src/Uri.cpp) (libSceHttp) - follows a payload process on a PS5 (firmware 13.60), which agrees with the [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp) reimplementation of the PS4 library: it is not RFC 3986 5.2.4, a path that doesn't start with `/` is copied unchanged and a trailing `.` or `..` is kept. Like the console, the byte at `srcSize - 1` is read as the `/` that ends a `..` segment, and `srcSize == 1` with a leading `/` writes `/`; whether it also ends a `.` segment was not measured, so a `.` there is still kept as before
- [sceHttpSetResponseHeaderMaxSize, sceHttpRedirectCacheFlush, sceHttpsUnloadCert](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - signatures follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp) (PS4); no PS5 reference has them
- [sceHttpSetRequestStatusCallback](../../../core/libs/prx/libSceHttp/Export.cpp) - the three-argument ABI follows [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp). 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](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - signatures follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp) (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`
- [sceHttpSetRedirectCallback, sceHttpSetCookieRecvCallback, sceHttpsSetSslVersion, sceHttpsGetSslError](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - signatures follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp) (PS4), which only logs and returns 0; the `sceHttpSetCookieSendCallback` signature follows [Orbital's type database](https://github.com/AlexAltea/orbital/blob/b321fcdbd700cc02da1cb1ad25412781d5ec73c6/tools/ida/db_types.json) (PS4), and the callback it accepts is never called as no request sends cookies; a null `errNum` or `detail` in `sceHttpsGetSslError` is assumed to return `SCE_HTTP_ERROR_INVALID_VALUE` like `sceHttpGetLastErrno`
- [sceHttpSetAuthInfoCallback](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - signature and callback type follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.h) (PS4); no PS5 reference has them. The `id` is not checked, as in the other libSceHttp setters
- [sceHttpWaitRequest](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - measured on PS5 firmware 13.590.001 (a title process): the timeout is in microseconds (a 1000 µs wait returned after about 1.1 ms, 20000 µs after about 20.1 ms, 100000 µs after about 100.1 ms); a -1 timeout was still blocked 1.5 s later, consistent with waiting without a limit; the invalid-value error `0x804311FE` is returned for a null handle, a null event array, and a count of 0 or -1; no request is ever pending, so a wait returns 0 events when its timeout passes. Two titles disassembled for this entry pass a stack event array and a small positive timeout: PPSA21564 01.007.000 (at 0x10A792A) one event and 10, PPSA34502 01.010.000 (0x717B8D) eight and 100000, which is 100 ms as microseconds but 100 s as milliseconds. Both treat a negative result as an error and 0 as no event
- [sceHttpUriCopy](../../../core/libs/prx/libSceHttp/src/Uri.cpp) (libSceHttp) - unverified: whether the strings are written before the size check, which a short pool hides by ending cleared. The rest follows a payload process on a PS5 (firmware 13.60): the arguments are (out, src, pool, prepare, require) as in the disassembly; the whole output and all `prepare` pool bytes are cleared before the source is read, so a source that is the output or lies in the pool copies as empty; the scheme, hostname, path, username and password are copied in that order with terminators, a null one as empty, and the port, while the query, fragment and opaque flag stay 0; a short pool returns 0x80431022 and leaves `require` alone; a null source returns 0x80433060, and no output or pool with a null `require` 0x804311FE
Expand Down Expand Up @@ -58,7 +58,7 @@ Sony guest HTTP requests still do not reach the network. The separate `Aps5HttpC

- [sceHttpAuthCacheFlush, sceHttpCookieFlush](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - the context-id signatures follow [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Net/Http.cs), and the NIDs `zzB0StvRab4` and `seCvUt91WHY` match [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp). The offline backend never stores authentication credentials, so flushing them succeeds with an empty cache; `sceHttpCookieFlush` empties the cookie store below. `sceHttpCookieFlush` returns `INVALID_ID` (0x80431100) for any id without a live context, as measured on firmware 13.42. `sceHttpAuthCacheFlush` returns `BEFORE_INIT` (0x80431001) when no context is alive and `INVALID_ID` for an unknown, deleted or non-context handle, following the existing context lifecycle checks; its codes have not been measured on PS5 hardware; shadPS4 only stubs these calls. Network-backed caches remain unimplemented.
- [sceHttpAbortWaitRequest, sceHttpWaitRequest](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - the abort takes only the epoll handle, as in [Orbital](https://github.com/AlexAltea/orbital/blob/master/tools/ida/db_types.json) and [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Net/Http.cs); behaviour and error codes follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp) (PS4). On a PS5 (13.590.001) later waits and polls returned `SCE_HTTP_ERROR_ABORTED` (0x80431080); lasting until destroy and waking a blocked wait are unconfirmed. 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
- [Cookie store](../../../core/libs/prx/libSceHttp/src/Cookies.cpp) (libSceHttp) - follows calls measured on firmware 13.42 `libSceHttp.sprx` in [#10535](https://github.com/boykopovar/AnyPS5/pull/10535), including the default limits (4096 bytes, 50 per domain, 3000 cookies, 81920 bytes) and eviction; [RFC 6265](https://www.rfc-editor.org/rfc/rfc6265) dates. No request sends or receives cookies. `sceHttpSetCookieSendCallback` is not measured nor implemented.
- [Cookie store](../../../core/libs/prx/libSceHttp/src/Cookies.cpp) (libSceHttp) - follows calls measured on firmware 13.42 `libSceHttp.sprx` in [#10535](https://github.com/boykopovar/AnyPS5/pull/10535), including the default limits (4096 bytes, 50 per domain, 3000 cookies, 81920 bytes) and eviction; [RFC 6265](https://www.rfc-editor.org/rfc/rfc6265) dates. No request sends or receives cookies. `sceHttpSetCookieSendCallback` is not measured.

- [sceHttpCookieExport and sceHttpCookieImport](../../../core/libs/prx/libSceHttp/src/Cookies.cpp) (libSceHttp) - export writes a host-defined binary blob (`APS5CK1`, little-endian length-prefixed fields, creation order and optional expiry) and import replaces the jar with it; the console's format and replacement-or-merge behavior are unmeasured, and this blob is only guaranteed to round-trip through this implementation. A blob exported on a console is rejected with `ERROR_INVALID_VALUE`. A null buffer queries the required size; a short buffer returns `ERROR_OUT_OF_SIZE`; malformed, truncated, oversized or unreadable data returns `ERROR_INVALID_VALUE` or `ERROR_OUT_OF_SIZE` and leaves the jar unchanged. An import above the current cookie-count, per-cookie, per-domain or total-size limits returns `ERROR_OUT_OF_SIZE`; expired cookies are dropped and an expiry outside the clock range is clamped. The error codes, size bound and import limit checks are host choices, not console measurements.
- [sceHttpCreateEpoll](../../../core/libs/prx/libSceHttp/Export.cpp) (libSceHttp) - returning `SCE_HTTP_ERROR_INVALID_VALUE` (`0x804311FE`) for an unwritable epoll handle pointer via `GuestCopyOut_nid_no_patch` is a host-safety fallback with console behavior unmeasured.
Expand Down
Loading