From ad1799c1c9d2c759685fb30c159c0df5cc5c61e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 12 Jan 2025 18:02:43 +0100 Subject: [PATCH] Add some TODOs in sceHttp --- Core/HLE/sceHttp.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceHttp.cpp b/Core/HLE/sceHttp.cpp index 4b142e24cc..e5f7aaf9bc 100644 --- a/Core/HLE/sceHttp.cpp +++ b/Core/HLE/sceHttp.cpp @@ -578,7 +578,7 @@ static int sceHttpCreateRequest(int connectionID, int method, const char *path, return hleLogSuccessI(Log::sceNet, retid); } -// FIXME: port type is probably u16 +// FIXME: port type is probably u16 (but passed in a single register anyway, so type doesn't matter) static int sceHttpCreateConnection(int templateID, const char *hostString, const char *scheme, u32 port, int enableKeepalive) { WARN_LOG(Log::sceNet, "UNTESTED sceHttpCreateConnection(%d, %s, %s, %d, %d)", templateID, safe_string(hostString), safe_string(scheme), port, enableKeepalive); std::lock_guard guard(httpLock); @@ -588,6 +588,8 @@ static int sceHttpCreateConnection(int templateID, const char *hostString, const if (httpObjects[templateID - 1LL]->className() != name_HTTPTemplate) return hleLogError(Log::sceNet, SCE_HTTP_ERROR_INVALID_ID, "invalid id"); + // TODO: Look up hostString in DNS here. + httpObjects.emplace_back(std::make_shared(templateID, hostString ? hostString : "", scheme ? scheme : "", port, enableKeepalive)); int retid = (int)httpObjects.size(); return hleLogSuccessI(Log::sceNet, retid); @@ -742,7 +744,7 @@ static int sceHttpCreateRequestWithURL(int connectionID, int method, const char if (!baseURL.Valid()) return hleLogError(Log::sceNet, SCE_HTTP_ERROR_INVALID_URL, "invalid url"); - httpObjects.emplace_back(std::make_shared(connectionID, method, url? url:"", contentLength)); + httpObjects.emplace_back(std::make_shared(connectionID, method, url ? url : "", contentLength)); int retid = (int)httpObjects.size(); return hleLogSuccessI(Log::sceNet, retid); } @@ -756,10 +758,12 @@ static int sceHttpCreateConnectionWithURL(int templateID, const char *url, int e if (httpObjects[templateID - 1LL]->className() != name_HTTPTemplate) return hleLogError(Log::sceNet, SCE_HTTP_ERROR_INVALID_ID, "invalid id"); - Url baseURL(url? url: ""); + Url baseURL(url ? url: ""); if (!baseURL.Valid()) return hleLogError(Log::sceNet, SCE_HTTP_ERROR_INVALID_URL, "invalid url"); + // TODO: Here we should look up baseURL.Host() in DNS. + httpObjects.emplace_back(std::make_shared(templateID, baseURL.Host().c_str(), baseURL.Protocol().c_str(), baseURL.Port(), enableKeepalive)); int retid = (int)httpObjects.size(); return hleLogSuccessI(Log::sceNet, retid);