diff --git a/src/client/http/Request.cpp b/src/client/http/Request.cpp index 2478c6c23..5e1c05b91 100644 --- a/src/client/http/Request.cpp +++ b/src/client/http/Request.cpp @@ -88,7 +88,7 @@ namespace http return handle->state == RequestHandle::done; } - std::pair Request::CheckProgress() const + std::pair Request::CheckProgress() const { std::lock_guard lk(handle->stateMx); assert(handle->state == RequestHandle::running || handle->state == RequestHandle::done); diff --git a/src/client/http/Request.h b/src/client/http/Request.h index 2c6898499..4f75d5666 100644 --- a/src/client/http/Request.h +++ b/src/client/http/Request.h @@ -39,7 +39,7 @@ namespace http void Start(); bool CheckDone() const; - std::pair CheckProgress() const; // total, done + std::pair CheckProgress() const; // total, done const std::vector &ResponseHeaders() const; void Wait(); diff --git a/src/client/http/requestmanager/Libcurl.cpp b/src/client/http/requestmanager/Libcurl.cpp index 4e16fbdb3..641bbb50f 100644 --- a/src/client/http/requestmanager/Libcurl.cpp +++ b/src/client/http/requestmanager/Libcurl.cpp @@ -221,8 +221,8 @@ namespace http HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &total)); // stores -1 if unknown HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_SIZE_DOWNLOAD, &done)); #endif - handle->bytesTotal = int(total); - handle->bytesDone = int(done); + handle->bytesTotal = int64_t(total); + handle->bytesDone = int64_t(done); } else { diff --git a/src/client/http/requestmanager/RequestManager.h b/src/client/http/requestmanager/RequestManager.h index a5e82ae56..4f56d5b79 100644 --- a/src/client/http/requestmanager/RequestManager.h +++ b/src/client/http/requestmanager/RequestManager.h @@ -3,6 +3,7 @@ #include "common/String.h" #include "client/http/PostData.h" #include +#include #include #include #include @@ -38,8 +39,8 @@ namespace http State state = ready; std::mutex stateMx; std::condition_variable stateCv; - std::atomic bytesTotal = -1; - std::atomic bytesDone = 0; + std::atomic bytesTotal = -1; + std::atomic bytesDone = 0; int statusCode = 0; ByteString responseData; std::vector responseHeaders; diff --git a/src/gui/game/IntroText.h b/src/gui/game/IntroText.h index 99813f85a..83d77c6a0 100644 --- a/src/gui/game/IntroText.h +++ b/src/gui/game/IntroText.h @@ -58,13 +58,13 @@ inline ByteString IntroText() { sb << " NOHTTP"; } + else if constexpr (ENFORCE_HTTPS) + { + sb << " HTTPS"; + } if constexpr (DEBUG) { sb << " DEBUG"; } - if constexpr (ENFORCE_HTTPS) - { - sb << " HTTPS"; - } return sb.Build(); } diff --git a/src/gui/update/UpdateActivity.cpp b/src/gui/update/UpdateActivity.cpp index bad425682..33ecf0ecd 100644 --- a/src/gui/update/UpdateActivity.cpp +++ b/src/gui/update/UpdateActivity.cpp @@ -39,7 +39,7 @@ private: notifyProgress(-1); while(!request->CheckDone()) { - int total, done; + int64_t total, done; std::tie(total, done) = request->CheckProgress(); if (total == -1) { diff --git a/src/lua/LuaHttp.cpp b/src/lua/LuaHttp.cpp index 4f619d847..194ad05c6 100644 --- a/src/lua/LuaHttp.cpp +++ b/src/lua/LuaHttp.cpp @@ -103,7 +103,7 @@ public: return request->CheckDone(); } - void Progress(int *total, int *done) + void Progress(int64_t *total, int64_t *done) { if (!dead) { @@ -188,7 +188,7 @@ static int http_request_progress(lua_State *l) auto *rh = (RequestHandle *)luaL_checkudata(l, 1, "HTTPRequest"); if (!rh->Dead()) { - int total, done; + int64_t total, done; rh->Progress(&total, &done); lua_pushinteger(l, total); lua_pushinteger(l, done);