From c387cc36101ba00bd900edcb5124f2c66bd9021c Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 13 Jan 2021 21:45:26 +0100 Subject: [PATCH] possible hotfix? --- src/Network/Http.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Network/Http.cpp b/src/Network/Http.cpp index 7a98050..4823b32 100644 --- a/src/Network/Http.cpp +++ b/src/Network/Http.cpp @@ -48,13 +48,14 @@ std::string HttpRequest(const std::string& IP, int port) { } std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json) { - auto header = curl_slist { (char*)"Content-Type: application/json" }; + auto header = curl_slist { (char*)"Content-Type: application/json", nullptr }; static std::mutex Lock; std::scoped_lock Guard(Lock); CurlManager M; CURL* curl = M.Get(); CURLcode res; std::string readBuffer; + readBuffer.resize(1000, 0); Assert(curl); if (curl) { @@ -64,7 +65,7 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, Fields.size()); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, Fields.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer[0]); curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); res = curl_easy_perform(curl);