From 820bba55adfe69e8de29c10a5a4cda555630566f Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Fri, 21 Mar 2025 18:53:27 +0200 Subject: [PATCH 1/9] added sceHttpParseStatusLine --- src/core/libraries/network/http.cpp | 96 ++++++++++++++++++++++++++++- src/core/libraries/network/http.h | 5 +- 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index dbb5b096a..e7a47cff5 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -272,9 +272,99 @@ int PS4_SYSV_ABI sceHttpParseResponseHeader() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpParseStatusLine() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); - return ORBIS_OK; +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, + int32_t* httpMajorVer, int32_t* httpMinorVer, + int32_t* responseCode, const char** reasonPhrase, + size_t* phraseLen) { + if (!statusLine) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + if (!httpMajorVer || !httpMinorVer || !responseCode || !reasonPhrase || !phraseLen) { + LOG_ERROR(Lib_Http, "Invalid value"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_VALUE; + } + *httpMajorVer = 0; + *httpMinorVer = 0; + if (lineLen < 8) { + LOG_ERROR(Lib_Http, "Linelen is smaller than 8"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + if (strncmp(statusLine, "HTTP/", 5) != 0) { + LOG_ERROR(Lib_Http, "statusLine doesn't start with HTTP/"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + size_t index = 5; + + if (!isdigit(statusLine[index])) { + LOG_ERROR(Lib_Http, "Invalid response"); + + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + while (isdigit(statusLine[index])) { + *httpMajorVer = *httpMajorVer * 10 + (statusLine[index] - '0'); + index++; + } + + if (statusLine[index] != '.') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + if (!isdigit(statusLine[index])) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + while (isdigit(statusLine[index])) { + *httpMinorVer = *httpMinorVer * 10 + (statusLine[index] - '0'); + index++; + } + + if (statusLine[index] != ' ') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + // Validate and parse the 3-digit HTTP response code + if (lineLen - index < 3 || !isdigit(statusLine[index]) || !isdigit(statusLine[index + 1]) || + !isdigit(statusLine[index + 2])) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + *responseCode = (statusLine[index] - '0') * 100 + (statusLine[index + 1] - '0') * 10 + + (statusLine[index + 2] - '0'); + index += 3; + + if (statusLine[index] != ' ') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + // Set the reason phrase start position + *reasonPhrase = &statusLine[index]; + size_t phraseStart = index; + + while (index < lineLen && statusLine[index] != '\n') { + index++; + } + + // Determine the length of the reason phrase, excluding trailing \r if present + if (index == phraseStart) { + *phraseLen = 0; + } else { + *phraseLen = + (statusLine[index - 1] == '\r') ? (index - phraseStart - 1) : (index - phraseStart); + } + + // Return the number of bytes processed + return index + 1; } int PS4_SYSV_ABI sceHttpReadData() { diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index c687c60c4..dbac179f6 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -76,7 +76,10 @@ int PS4_SYSV_ABI sceHttpGetResponseContentLength(); int PS4_SYSV_ABI sceHttpGetStatusCode(); int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize); int PS4_SYSV_ABI sceHttpParseResponseHeader(); -int PS4_SYSV_ABI sceHttpParseStatusLine(); +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, + int32_t* httpMajorVer, int32_t* httpMinorVer, + int32_t* responseCode, const char** reasonPhrase, + size_t* phraseLen); int PS4_SYSV_ABI sceHttpReadData(); int PS4_SYSV_ABI sceHttpRedirectCacheFlush(); int PS4_SYSV_ABI sceHttpRemoveRequestHeader(); From 73c101476eaa5efab79dd965767a1c59a0df000f Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 27 Mar 2025 17:23:01 +0200 Subject: [PATCH 2/9] added sceHttpUriMerge --- src/core/libraries/network/http.cpp | 117 ++++++++++++++++++++++++++-- src/core/libraries/network/http.h | 10 ++- 2 files changed, 119 insertions(+), 8 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index e7a47cff5..29f1b6726 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -9,6 +9,26 @@ namespace Libraries::Http { +void NormalizeAndAppendPath(char* dest, char* src) { + char* lastSlash; + size_t length; + + lastSlash = strrchr(dest, 0x2f); + if (lastSlash == NULL) { + length = strlen(dest); + dest[length] = '/'; + dest[length + 1] = '\0'; + } else { + lastSlash[1] = '\0'; + } + if (*src == '/') { + dest[0] = '\0'; + } + length = strnlen(dest, 0x3fff); + strncat(dest, src, 0x3fff - length); + return; +} + int PS4_SYSV_ABI sceHttpAbortRequest() { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; @@ -267,7 +287,9 @@ int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolS return ++id; } -int PS4_SYSV_ABI sceHttpParseResponseHeader() { +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, size_t headerLen, + const char* fieldStr, const char** fieldValue, + size_t* valueLen) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } @@ -637,7 +659,8 @@ int PS4_SYSV_ABI sceHttpUnsetEpoll() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriBuild() { +int PS4_SYSV_ABI sceHttpUriBuild(char* out, size_t* require, size_t prepare, + const OrbisHttpUriElement* srcElement, u32 option) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } @@ -652,9 +675,93 @@ int PS4_SYSV_ABI sceHttpUriEscape() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriMerge() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); - return ORBIS_OK; +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, size_t* require, + size_t prepare, u32 option) { + u64 requiredLength; + int returnValue; + u64 baseUrlLength; + u64 relativeUriLength; + u64 totalLength; + u64 combinedLength; + int parseResult; + u64 localSizeRelativeUri; + u64 localSizeBaseUrl; + OrbisHttpUriElement parsedUriElement; + + if (option != 0 || url == NULL || relativeUri == NULL) { + LOG_ERROR(Lib_Http, "Invalid value"); + return ORBIS_HTTP_ERROR_INVALID_VALUE; + } + + returnValue = sceHttpUriParse(NULL, url, NULL, &localSizeBaseUrl, 0); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + returnValue = sceHttpUriParse(NULL, relativeUri, NULL, &localSizeRelativeUri, 0); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + baseUrlLength = strnlen(url, 0x3fff); + relativeUriLength = strnlen(relativeUri, 0x3fff); + requiredLength = localSizeBaseUrl + 2 + (relativeUriLength + baseUrlLength) * 2; + + if (require) { + *require = requiredLength; + } + + if (mergedUrl == NULL) { + return ORBIS_OK; + } + + if (prepare < requiredLength) { + LOG_ERROR(Lib_Http, "Error Out of memory"); + return ORBIS_HTTP_ERROR_OUT_OF_MEMORY; + } + + totalLength = strnlen(url, 0x3fff); + baseUrlLength = strnlen(relativeUri, 0x3fff); + combinedLength = totalLength + 1 + baseUrlLength; + relativeUriLength = prepare - combinedLength; + + returnValue = + sceHttpUriParse(&parsedUriElement, relativeUri, mergedUrl + totalLength + baseUrlLength + 1, + &localSizeRelativeUri, relativeUriLength); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + if (parsedUriElement.scheme == NULL) { + strncpy(mergedUrl, relativeUri, requiredLength); + if (require) { + *require = strnlen(relativeUri, 0x3fff) + 1; + } + return ORBIS_OK; + } + + returnValue = + sceHttpUriParse(&parsedUriElement, url, mergedUrl + totalLength + baseUrlLength + 1, + &localSizeBaseUrl, relativeUriLength); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + combinedLength += localSizeBaseUrl; + strncpy(mergedUrl + combinedLength, parsedUriElement.path, prepare - combinedLength); + NormalizeAndAppendPath(mergedUrl + combinedLength, relativeUri); + + returnValue = sceHttpUriBuild(mergedUrl, 0, ~(baseUrlLength + totalLength) + prepare, + &parsedUriElement, 0x3f); + if (returnValue >= 0) { + return ORBIS_OK; + } else { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } } int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index dbac179f6..2eb6e3cf1 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -75,7 +75,9 @@ int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds(); int PS4_SYSV_ABI sceHttpGetResponseContentLength(); int PS4_SYSV_ABI sceHttpGetStatusCode(); int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize); -int PS4_SYSV_ABI sceHttpParseResponseHeader(); +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, size_t headerLen, + const char* fieldStr, const char** fieldValue, + size_t* valueLen); int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, int32_t* httpMajorVer, int32_t* httpMinorVer, int32_t* responseCode, const char** reasonPhrase, @@ -134,10 +136,12 @@ int PS4_SYSV_ABI sceHttpTerm(); int PS4_SYSV_ABI sceHttpTryGetNonblock(); int PS4_SYSV_ABI sceHttpTrySetNonblock(); int PS4_SYSV_ABI sceHttpUnsetEpoll(); -int PS4_SYSV_ABI sceHttpUriBuild(); +int PS4_SYSV_ABI sceHttpUriBuild(char* out, size_t* require, size_t prepare, + const OrbisHttpUriElement* srcElement, u32 option); int PS4_SYSV_ABI sceHttpUriCopy(); int PS4_SYSV_ABI sceHttpUriEscape(); -int PS4_SYSV_ABI sceHttpUriMerge(); +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, size_t* require, + size_t prepare, u32 option); int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, size_t* require, size_t prepare); int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize); From a4acb6f6c4474e2386833d848beec21e7cc2e680 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 27 Mar 2025 18:23:08 +0200 Subject: [PATCH 3/9] macOS fix --- src/core/libraries/network/http.cpp | 4 ++-- src/core/libraries/network/http.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 29f1b6726..cd1289dff 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -675,8 +675,8 @@ int PS4_SYSV_ABI sceHttpUriEscape() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, size_t* require, - size_t prepare, u32 option) { +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, u64* require, + u64 prepare, u32 option) { u64 requiredLength; int returnValue; u64 baseUrlLength; diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index 2eb6e3cf1..ad7bd84a6 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -140,8 +140,8 @@ int PS4_SYSV_ABI sceHttpUriBuild(char* out, size_t* require, size_t prepare, const OrbisHttpUriElement* srcElement, u32 option); int PS4_SYSV_ABI sceHttpUriCopy(); int PS4_SYSV_ABI sceHttpUriEscape(); -int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, size_t* require, - size_t prepare, u32 option); +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, u64* require, + u64 prepare, u32 option); int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, size_t* require, size_t prepare); int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize); From d49cc2955a5773601296bf1cf2ff03924acab226 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 27 Mar 2025 22:46:28 +0200 Subject: [PATCH 4/9] more macOS fix? --- src/core/libraries/network/http.cpp | 46 ++++++++++++++--------------- src/core/libraries/network/http.h | 22 +++++++------- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index cd1289dff..8f00ef0b6 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -11,7 +11,7 @@ namespace Libraries::Http { void NormalizeAndAppendPath(char* dest, char* src) { char* lastSlash; - size_t length; + u64 length; lastSlash = strrchr(dest, 0x2f); if (lastSlash == NULL) { @@ -279,7 +279,7 @@ int PS4_SYSV_ABI sceHttpGetStatusCode() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize) { +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::u64 poolSize) { LOG_ERROR(Lib_Http, "(DUMMY) called libnetMemId = {} libsslCtxId = {} poolSize = {}", libnetMemId, libsslCtxId, poolSize); // return a value >1 @@ -287,17 +287,15 @@ int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolS return ++id; } -int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, size_t headerLen, - const char* fieldStr, const char** fieldValue, - size_t* valueLen) { +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, + const char** fieldValue, u64* valueLen) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, - int32_t* httpMajorVer, int32_t* httpMinorVer, - int32_t* responseCode, const char** reasonPhrase, - size_t* phraseLen) { +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, u64 lineLen, int32_t* httpMajorVer, + int32_t* httpMinorVer, int32_t* responseCode, + const char** reasonPhrase, u64* phraseLen) { if (!statusLine) { LOG_ERROR(Lib_Http, "Invalid response"); return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; @@ -317,7 +315,7 @@ int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; } - size_t index = 5; + u64 index = 5; if (!isdigit(statusLine[index])) { LOG_ERROR(Lib_Http, "Invalid response"); @@ -371,7 +369,7 @@ int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, // Set the reason phrase start position *reasonPhrase = &statusLine[index]; - size_t phraseStart = index; + u64 phraseStart = index; while (index < lineLen && statusLine[index] != '\n') { index++; @@ -659,7 +657,7 @@ int PS4_SYSV_ABI sceHttpUnsetEpoll() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriBuild(char* out, size_t* require, size_t prepare, +int PS4_SYSV_ABI sceHttpUriBuild(char* out, u64* require, u64 prepare, const OrbisHttpUriElement* srcElement, u32 option) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; @@ -765,7 +763,7 @@ int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, } int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, - size_t* require, size_t prepare) { + u64* require, u64 prepare) { LOG_INFO(Lib_Http, "srcUri = {}", std::string(srcUri)); if (!srcUri) { LOG_ERROR(Lib_Http, "invalid url"); @@ -782,10 +780,10 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v } // Track the total required buffer size - size_t requiredSize = 0; + u64 requiredSize = 0; // Parse the scheme (e.g., "http:", "https:", "file:") - size_t schemeLength = 0; + u64 schemeLength = 0; while (srcUri[schemeLength] && srcUri[schemeLength] != ':') { if (!isalnum(srcUri[schemeLength])) { LOG_ERROR(Lib_Http, "invalid url"); @@ -807,7 +805,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v requiredSize += schemeLength + 1; // Move past the scheme and ':' character - size_t offset = schemeLength + 1; + u64 offset = schemeLength + 1; // Check if "//" appears after the scheme if (strncmp(srcUri + offset, "//", 2) == 0) { @@ -834,7 +832,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the path (everything after the slashes) char* pathStart = (char*)srcUri + offset; - size_t pathLength = 0; + u64 pathLength = 0; while (pathStart[pathLength] && pathStart[pathLength] != '?' && pathStart[pathLength] != '#') { pathLength++; @@ -885,7 +883,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v hostStart++; } - size_t hostLength = 0; + u64 hostLength = 0; while (hostStart[hostLength] && hostStart[hostLength] != '/' && hostStart[hostLength] != '?' && hostStart[hostLength] != ':') { hostLength++; @@ -910,7 +908,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the port (if present) if (hostStart[hostLength] == ':') { char* portStart = hostStart + hostLength + 1; - size_t portLength = 0; + u64 portLength = 0; while (portStart[portLength] && isdigit(portStart[portLength])) { portLength++; } @@ -950,7 +948,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the path (if present) if (srcUri[offset] == '/') { char* pathStart = (char*)srcUri + offset; - size_t pathLength = 0; + u64 pathLength = 0; while (pathStart[pathLength] && pathStart[pathLength] != '?' && pathStart[pathLength] != '#') { pathLength++; @@ -976,7 +974,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the query (if present) if (srcUri[offset] == '?') { char* queryStart = (char*)srcUri + offset + 1; - size_t queryLength = 0; + u64 queryLength = 0; while (queryStart[queryLength] && queryStart[queryLength] != '#') { queryLength++; } @@ -1001,7 +999,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the fragment (if present) if (srcUri[offset] == '#') { char* fragmentStart = (char*)srcUri + offset + 1; - size_t fragmentLength = 0; + u64 fragmentLength = 0; while (fragmentStart[fragmentLength]) { fragmentLength++; } @@ -1029,12 +1027,12 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize) { +int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, u64 srcSize) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriUnescape(char* out, size_t* require, size_t prepare, const char* in) { +int PS4_SYSV_ABI sceHttpUriUnescape(char* out, u64* require, u64 prepare, const char* in) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index ad7bd84a6..0d2e3c938 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -74,14 +74,12 @@ int PS4_SYSV_ABI sceHttpGetNonblock(); int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds(); int PS4_SYSV_ABI sceHttpGetResponseContentLength(); int PS4_SYSV_ABI sceHttpGetStatusCode(); -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize); -int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, size_t headerLen, - const char* fieldStr, const char** fieldValue, - size_t* valueLen); -int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, size_t lineLen, - int32_t* httpMajorVer, int32_t* httpMinorVer, - int32_t* responseCode, const char** reasonPhrase, - size_t* phraseLen); +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::u64 poolSize); +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, + const char** fieldValue, u64* valueLen); +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, u64 lineLen, int32_t* httpMajorVer, + int32_t* httpMinorVer, int32_t* responseCode, + const char** reasonPhrase, u64* phraseLen); int PS4_SYSV_ABI sceHttpReadData(); int PS4_SYSV_ABI sceHttpRedirectCacheFlush(); int PS4_SYSV_ABI sceHttpRemoveRequestHeader(); @@ -136,16 +134,16 @@ int PS4_SYSV_ABI sceHttpTerm(); int PS4_SYSV_ABI sceHttpTryGetNonblock(); int PS4_SYSV_ABI sceHttpTrySetNonblock(); int PS4_SYSV_ABI sceHttpUnsetEpoll(); -int PS4_SYSV_ABI sceHttpUriBuild(char* out, size_t* require, size_t prepare, +int PS4_SYSV_ABI sceHttpUriBuild(char* out, u64* require, u64 prepare, const OrbisHttpUriElement* srcElement, u32 option); int PS4_SYSV_ABI sceHttpUriCopy(); int PS4_SYSV_ABI sceHttpUriEscape(); int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, u64* require, u64 prepare, u32 option); int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, - size_t* require, size_t prepare); -int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize); -int PS4_SYSV_ABI sceHttpUriUnescape(char* out, size_t* require, size_t prepare, const char* in); + u64* require, u64 prepare); +int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, u64 srcSize); +int PS4_SYSV_ABI sceHttpUriUnescape(char* out, u64* require, u64 prepare, const char* in); int PS4_SYSV_ABI sceHttpWaitRequest(); void RegisterlibSceHttp(Core::Loader::SymbolsResolver* sym); From adc7c28cb46352b090f19e011f4f86c7c84d58a4 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 27 Mar 2025 22:47:26 +0200 Subject: [PATCH 5/9] typo --- src/core/libraries/network/http.cpp | 2 +- src/core/libraries/network/http.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 8f00ef0b6..abad196c2 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -279,7 +279,7 @@ int PS4_SYSV_ABI sceHttpGetStatusCode() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::u64 poolSize) { +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize) { LOG_ERROR(Lib_Http, "(DUMMY) called libnetMemId = {} libsslCtxId = {} poolSize = {}", libnetMemId, libsslCtxId, poolSize); // return a value >1 diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index 0d2e3c938..e94f30dd9 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -74,7 +74,7 @@ int PS4_SYSV_ABI sceHttpGetNonblock(); int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds(); int PS4_SYSV_ABI sceHttpGetResponseContentLength(); int PS4_SYSV_ABI sceHttpGetStatusCode(); -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::u64 poolSize); +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize); int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, const char** fieldValue, u64* valueLen); int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, u64 lineLen, int32_t* httpMajorVer, From 454bef69cb8149335ac5cdf282d9f881948b2e92 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Tue, 8 Apr 2025 19:13:42 +0300 Subject: [PATCH 6/9] Update src/core/libraries/network/http.cpp Co-authored-by: illusony <37698908+illusion0001@users.noreply.github.com> --- src/core/libraries/network/http.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index abad196c2..d9f57bf88 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -13,7 +13,7 @@ void NormalizeAndAppendPath(char* dest, char* src) { char* lastSlash; u64 length; - lastSlash = strrchr(dest, 0x2f); + lastSlash = strrchr(dest, '/'); if (lastSlash == NULL) { length = strlen(dest); dest[length] = '/'; From c0b23eace9704ddba662535c86651b18f6011f78 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Sat, 19 Apr 2025 20:10:44 +0300 Subject: [PATCH 7/9] some work on sceHttpGetStatusCode --- src/core/libraries/network/http.cpp | 67 ++++++++++++++++++++++++++++- src/core/libraries/network/http.h | 4 +- 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index d9f57bf88..7e2e8295e 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -204,7 +204,7 @@ int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpGetAllResponseHeaders() { +int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } @@ -274,8 +274,71 @@ int PS4_SYSV_ABI sceHttpGetResponseContentLength() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpGetStatusCode() { +int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { LOG_ERROR(Lib_Http, "(STUBBED) called"); +#if 0 + uint uVar1; + int iVar2; + undefined8 uVar3; + long local_60; + undefined1 local_58 [8]; + undefined1 local_50 [8]; + long local_48; + undefined8 local_40; + long local_38; + + local_38 = ___stack_chk_guard; + local_40 = 0; + local_48 = 0; + if (g_isHttpInitialized == 0) { + iVar2 = -0x7fbcefff; + } + else if (statusCode == (int *)0x0) { + iVar2 = -0x7fbcee02; + } + else { + uVar1 = getSdkVersion(); + iVar2 = scePthreadAttrInit(local_50); + if ((-1 < iVar2) || (uVar1 < 0x3000000)) { + uVar3 = scePthreadSelf(); + iVar2 = scePthreadAttrGet(uVar3,local_50); + if ((iVar2 < 0) && (0x2ffffff < uVar1)) { + scePthreadAttrDestroy(local_50); + } + else { + iVar2 = scePthreadAttrGetstack(local_50,&local_60,local_58); + scePthreadAttrDestroy(local_50); + if (((-1 < iVar2) || (uVar1 < 0x3000000)) && + ((uVar1 < 0x1000000 || + (iVar2 = -0x7fbcef8a, 0x3fcf < (ulong)((long)&local_40 - local_60))))) { + iVar2 = FUN_01018c20(&local_48,reqId); + if ((-1 < iVar2) && (iVar2 = scePthreadMutexLock(local_48 + 0x530), -1 < iVar2)) { + iVar2 = -0x7fbcef9b; + if (0x11 < *(int *)(local_48 + 0x20)) { + if (*(int *)(local_48 + 0x20) == 0x16) { + iVar2 = *(int *)(local_48 + 0x28); + } + else { + iVar2 = 0; + *statusCode = *(int *)(local_48 + 0x20c); + } + } + scePthreadMutexUnlock(local_48 + 0x530); + } + if (local_48 != 0) { + FUN_010195c0(); + } + } + } + } + } + if (___stack_chk_guard != local_38) { + /* WARNING: Subroutine does not return */ + __stack_chk_fail(); + } + return iVar2; +#endif + *statusCode = 404; // not found return ORBIS_OK; } diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index e94f30dd9..e3df817cc 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -59,7 +59,7 @@ int PS4_SYSV_ABI sceHttpDeleteRequest(); int PS4_SYSV_ABI sceHttpDeleteTemplate(); int PS4_SYSV_ABI sceHttpDestroyEpoll(); int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled(); -int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(); +int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize); int PS4_SYSV_ABI sceHttpGetAuthEnabled(); int PS4_SYSV_ABI sceHttpGetAutoRedirect(); int PS4_SYSV_ABI sceHttpGetConnectionStat(); @@ -73,7 +73,7 @@ int PS4_SYSV_ABI sceHttpGetMemoryPoolStats(); int PS4_SYSV_ABI sceHttpGetNonblock(); int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds(); int PS4_SYSV_ABI sceHttpGetResponseContentLength(); -int PS4_SYSV_ABI sceHttpGetStatusCode(); +int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode); int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize); int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, const char** fieldValue, u64* valueLen); From 48b1c8febeb9c410235db0f5de9a4dc30c5a57f4 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Sat, 19 Apr 2025 20:43:04 +0300 Subject: [PATCH 8/9] more draft on GetStatusCode --- src/core/libraries/network/http.cpp | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 7e2e8295e..60f2533b4 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -278,7 +278,9 @@ int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { LOG_ERROR(Lib_Http, "(STUBBED) called"); #if 0 uint uVar1; - int iVar2; +#endif + int returnCode; +#if 0 undefined8 uVar3; long local_60; undefined1 local_58 [8]; @@ -291,35 +293,38 @@ int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { local_40 = 0; local_48 = 0; if (g_isHttpInitialized == 0) { - iVar2 = -0x7fbcefff; - } - else if (statusCode == (int *)0x0) { - iVar2 = -0x7fbcee02; + returnCode = -0x7fbcefff; } +#endif + if (statusCode == nullptr) { + // returnCode = ORBIS_HTTP_ERROR_INVALID_VALUE; //TODO + return ORBIS_HTTP_ERROR_INVALID_VALUE; + } +#if 0 else { uVar1 = getSdkVersion(); - iVar2 = scePthreadAttrInit(local_50); - if ((-1 < iVar2) || (uVar1 < 0x3000000)) { + returnCode = scePthreadAttrInit(local_50); + if ((-1 < returnCode) || (uVar1 < 0x3000000)) { uVar3 = scePthreadSelf(); - iVar2 = scePthreadAttrGet(uVar3,local_50); - if ((iVar2 < 0) && (0x2ffffff < uVar1)) { + returnCode = scePthreadAttrGet(uVar3,local_50); + if ((returnCode < 0) && (0x2ffffff < uVar1)) { scePthreadAttrDestroy(local_50); } else { - iVar2 = scePthreadAttrGetstack(local_50,&local_60,local_58); + returnCode = scePthreadAttrGetstack(local_50,&local_60,local_58); scePthreadAttrDestroy(local_50); - if (((-1 < iVar2) || (uVar1 < 0x3000000)) && + if (((-1 < returnCode) || (uVar1 < 0x3000000)) && ((uVar1 < 0x1000000 || - (iVar2 = -0x7fbcef8a, 0x3fcf < (ulong)((long)&local_40 - local_60))))) { - iVar2 = FUN_01018c20(&local_48,reqId); - if ((-1 < iVar2) && (iVar2 = scePthreadMutexLock(local_48 + 0x530), -1 < iVar2)) { - iVar2 = -0x7fbcef9b; + (returnCode = -0x7fbcef8a, 0x3fcf < (ulong)((long)&local_40 - local_60))))) { + returnCode = FUN_01018c20(&local_48,reqId); + if ((-1 < returnCode) && (returnCode = scePthreadMutexLock(local_48 + 0x530), -1 < returnCode)) { + returnCode = -0x7fbcef9b; if (0x11 < *(int *)(local_48 + 0x20)) { if (*(int *)(local_48 + 0x20) == 0x16) { - iVar2 = *(int *)(local_48 + 0x28); + returnCode = *(int *)(local_48 + 0x28); } else { - iVar2 = 0; + returnCode = 0; *statusCode = *(int *)(local_48 + 0x20c); } } @@ -336,7 +341,7 @@ int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } - return iVar2; + return returnCode; #endif *statusCode = 404; // not found return ORBIS_OK; From 852c7c0d224db5ac97a156a24026270550f2aea8 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Sun, 20 Apr 2025 10:25:19 +0300 Subject: [PATCH 9/9] added some debug info --- src/core/libraries/network/http.cpp | 123 +++++++++++----------------- src/core/libraries/network/http.h | 17 +++- 2 files changed, 62 insertions(+), 78 deletions(-) diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 60f2533b4..8b451a3a1 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -9,6 +9,8 @@ namespace Libraries::Http { +static bool g_isHttpInitialized = true; // TODO temp always inited + void NormalizeAndAppendPath(char* dest, char* src) { char* lastSlash; u64 length; @@ -29,6 +31,13 @@ void NormalizeAndAppendPath(char* dest, char* src) { return; } +int HttpRequestInternal_Acquire(HttpRequestInternal** outRequest, u32 requestId) { + return 0; // TODO dummy +} +int HttpRequestInternal_Release(HttpRequestInternal* request) { + return 0; // TODO dummy +} + int PS4_SYSV_ABI sceHttpAbortRequest() { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; @@ -54,8 +63,9 @@ int PS4_SYSV_ABI sceHttpAddQuery() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpAddRequestHeader() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode) { + LOG_ERROR(Lib_Http, "(STUBBED) called id= {} name = {} value = {} mode = {}", id, + std::string(name), std::string(value), mode); return ORBIS_OK; } @@ -104,8 +114,9 @@ int PS4_SYSV_ABI sceHttpCreateConnection() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpCreateConnectionWithURL() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(int tmplId, const char* url, bool enableKeepalive) { + LOG_ERROR(Lib_Http, "(STUBBED) called tmpid = {} url = {} enableKeepalive = {}", tmplId, + std::string(url), enableKeepalive ? 1 : 0); return ORBIS_OK; } @@ -124,8 +135,10 @@ int PS4_SYSV_ABI sceHttpCreateRequest2() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpCreateRequestWithURL() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpCreateRequestWithURL(int connId, s32 method, const char* url, + u64 contentLength) { + LOG_ERROR(Lib_Http, "(STUBBED) called connId = {} method = {} url={} contentLength={}", connId, + method, url, contentLength); return ORBIS_OK; } @@ -205,7 +218,7 @@ int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled() { } int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize) { - LOG_ERROR(Lib_Http, "(STUBBED) called"); + LOG_ERROR(Lib_Http, "(STUBBED) called reqId = {}", reqId); return ORBIS_OK; } @@ -275,76 +288,38 @@ int PS4_SYSV_ABI sceHttpGetResponseContentLength() { } int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { - LOG_ERROR(Lib_Http, "(STUBBED) called"); + LOG_ERROR(Lib_Http, "(STUBBED) called reqId = {}", reqId); #if 0 - uint uVar1; -#endif - int returnCode; -#if 0 - undefined8 uVar3; - long local_60; - undefined1 local_58 [8]; - undefined1 local_50 [8]; - long local_48; - undefined8 local_40; - long local_38; - - local_38 = ___stack_chk_guard; - local_40 = 0; - local_48 = 0; - if (g_isHttpInitialized == 0) { - returnCode = -0x7fbcefff; - } -#endif - if (statusCode == nullptr) { - // returnCode = ORBIS_HTTP_ERROR_INVALID_VALUE; //TODO + if (!g_isHttpInitialized) + return ORBIS_HTTP_ERROR_BEFORE_INIT; + + if (statusCode == nullptr) return ORBIS_HTTP_ERROR_INVALID_VALUE; - } -#if 0 - else { - uVar1 = getSdkVersion(); - returnCode = scePthreadAttrInit(local_50); - if ((-1 < returnCode) || (uVar1 < 0x3000000)) { - uVar3 = scePthreadSelf(); - returnCode = scePthreadAttrGet(uVar3,local_50); - if ((returnCode < 0) && (0x2ffffff < uVar1)) { - scePthreadAttrDestroy(local_50); - } - else { - returnCode = scePthreadAttrGetstack(local_50,&local_60,local_58); - scePthreadAttrDestroy(local_50); - if (((-1 < returnCode) || (uVar1 < 0x3000000)) && - ((uVar1 < 0x1000000 || - (returnCode = -0x7fbcef8a, 0x3fcf < (ulong)((long)&local_40 - local_60))))) { - returnCode = FUN_01018c20(&local_48,reqId); - if ((-1 < returnCode) && (returnCode = scePthreadMutexLock(local_48 + 0x530), -1 < returnCode)) { - returnCode = -0x7fbcef9b; - if (0x11 < *(int *)(local_48 + 0x20)) { - if (*(int *)(local_48 + 0x20) == 0x16) { - returnCode = *(int *)(local_48 + 0x28); - } - else { - returnCode = 0; - *statusCode = *(int *)(local_48 + 0x20c); - } - } - scePthreadMutexUnlock(local_48 + 0x530); - } - if (local_48 != 0) { - FUN_010195c0(); - } + + int ret = 0; + // Lookup HttpRequestInternal by reqId + HttpRequestInternal* request = nullptr; + ret = HttpRequestInternal_Acquire(&request, reqId); + if (ret < 0) + return ret; + request->m_mutex.lock(); + if (request->state > 0x11) { + if (request->state == 0x16) { + ret = request->errorCode; + } else { + *statusCode = request->httpStatusCode; + ret = 0; } - } + } else { + ret = ORBIS_HTTP_ERROR_BEFORE_SEND; } - } - if (___stack_chk_guard != local_38) { - /* WARNING: Subroutine does not return */ - __stack_chk_fail(); - } - return returnCode; -#endif - *statusCode = 404; // not found + request->m_mutex.unlock(); + HttpRequestInternal_Release(request); + + return ret; +#else return ORBIS_OK; +#endif } int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize) { @@ -495,8 +470,8 @@ int PS4_SYSV_ABI sceHttpsEnableOptionPrivate() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpSendRequest() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpSendRequest(int reqId, const void* postData, u64 size) { + LOG_ERROR(Lib_Http, "(STUBBED) called reqId = {} size = {}", reqId, size); return ORBIS_OK; } diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index e3df817cc..6698b91be 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -3,6 +3,7 @@ #pragma once +#include #include "common/types.h" namespace Core::Loader { @@ -24,12 +25,19 @@ struct OrbisHttpUriElement { u8 reserved[10]; }; +struct HttpRequestInternal { + int state; // +0x20 + int errorCode; // +0x28 + int httpStatusCode; // +0x20C + std::mutex m_mutex; +}; + int PS4_SYSV_ABI sceHttpAbortRequest(); int PS4_SYSV_ABI sceHttpAbortRequestForce(); int PS4_SYSV_ABI sceHttpAbortWaitRequest(); int PS4_SYSV_ABI sceHttpAddCookie(); int PS4_SYSV_ABI sceHttpAddQuery(); -int PS4_SYSV_ABI sceHttpAddRequestHeader(); +int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode); int PS4_SYSV_ABI sceHttpAddRequestHeaderRaw(); int PS4_SYSV_ABI sceHttpAuthCacheExport(); int PS4_SYSV_ABI sceHttpAuthCacheFlush(); @@ -39,11 +47,12 @@ int PS4_SYSV_ABI sceHttpCookieExport(); int PS4_SYSV_ABI sceHttpCookieFlush(); int PS4_SYSV_ABI sceHttpCookieImport(); int PS4_SYSV_ABI sceHttpCreateConnection(); -int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(); +int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(int tmplId, const char* url, bool enableKeepalive); int PS4_SYSV_ABI sceHttpCreateEpoll(); int PS4_SYSV_ABI sceHttpCreateRequest(); int PS4_SYSV_ABI sceHttpCreateRequest2(); -int PS4_SYSV_ABI sceHttpCreateRequestWithURL(); +int PS4_SYSV_ABI sceHttpCreateRequestWithURL(int connId, s32 method, const char* url, + u64 contentLength); int PS4_SYSV_ABI sceHttpCreateRequestWithURL2(); int PS4_SYSV_ABI sceHttpCreateTemplate(); int PS4_SYSV_ABI sceHttpDbgEnableProfile(); @@ -88,7 +97,7 @@ int PS4_SYSV_ABI sceHttpsDisableOption(); int PS4_SYSV_ABI sceHttpsDisableOptionPrivate(); int PS4_SYSV_ABI sceHttpsEnableOption(); int PS4_SYSV_ABI sceHttpsEnableOptionPrivate(); -int PS4_SYSV_ABI sceHttpSendRequest(); +int PS4_SYSV_ABI sceHttpSendRequest(int reqId, const void* postData, u64 size); int PS4_SYSV_ABI sceHttpSetAcceptEncodingGZIPEnabled(); int PS4_SYSV_ABI sceHttpSetAuthEnabled(); int PS4_SYSV_ABI sceHttpSetAuthInfoCallback();