diff --git a/common/HTTPDownloader.cpp b/common/HTTPDownloader.cpp index 846e98b620..205f80e6b2 100644 --- a/common/HTTPDownloader.cpp +++ b/common/HTTPDownloader.cpp @@ -118,7 +118,7 @@ void HTTPDownloader::LockedPollRequests(std::unique_lock& lock) m_pending_http_requests.erase(m_pending_http_requests.begin() + index); lock.unlock(); - req->callback(-1, std::string(), Request::Data()); + req->callback(-1, req->content_type, Request::Data()); CloseRequest(req); @@ -140,7 +140,7 @@ void HTTPDownloader::LockedPollRequests(std::unique_lock& lock) // run callback with lock unheld lock.unlock(); - req->callback(req->status_code, std::move(req->content_type), std::move(req->data)); + req->callback(req->status_code, req->content_type, std::move(req->data)); CloseRequest(req); lock.lock(); } diff --git a/common/HTTPDownloader.h b/common/HTTPDownloader.h index 1d4e3586cc..e8306c3474 100644 --- a/common/HTTPDownloader.h +++ b/common/HTTPDownloader.h @@ -36,7 +36,7 @@ namespace Common struct Request { using Data = std::vector; - using Callback = std::function; + using Callback = std::function; enum class Type { diff --git a/common/HTTPDownloaderWinHTTP.cpp b/common/HTTPDownloaderWinHTTP.cpp index cb78d63264..36b6346115 100644 --- a/common/HTTPDownloaderWinHTTP.cpp +++ b/common/HTTPDownloaderWinHTTP.cpp @@ -259,7 +259,7 @@ bool HTTPDownloaderWinHttp::StartRequest(HTTPDownloader::Request* request) if (!WinHttpCrackUrl(url_wide.c_str(), static_cast(url_wide.size()), 0, &uc)) { Console.Error("WinHttpCrackUrl() failed: %u", GetLastError()); - req->callback(-1, std::string(), Request::Data()); + req->callback(-1, req->content_type, Request::Data()); delete req; return false; } @@ -271,7 +271,7 @@ bool HTTPDownloaderWinHttp::StartRequest(HTTPDownloader::Request* request) if (!req->hConnection) { Console.Error("Failed to start HTTP request for '%s': %u", req->url.c_str(), GetLastError()); - req->callback(-1, std::string(), Request::Data()); + req->callback(-1, req->content_type, Request::Data()); delete req; return false; } diff --git a/pcsx2/Frontend/GameList.cpp b/pcsx2/Frontend/GameList.cpp index 14488571a3..90fda1d187 100644 --- a/pcsx2/Frontend/GameList.cpp +++ b/pcsx2/Frontend/GameList.cpp @@ -885,7 +885,7 @@ bool GameList::DownloadCovers(const std::vector& url_templates, boo // we could actually do a few in parallel here... std::string filename(Common::HTTPDownloader::URLDecode(url)); downloader->CreateRequest(std::move(url), [use_serial, &save_callback, entry_path = std::move(entry_path), - filename = std::move(filename)](s32 status_code, std::string content_type, Common::HTTPDownloader::Request::Data data) { + filename = std::move(filename)](s32 status_code, const std::string& content_type, Common::HTTPDownloader::Request::Data data) { if (status_code != Common::HTTPDownloader::HTTP_OK || data.empty()) return;