From 2571cb147856cb3b860069082c2f3b97e3bbc4c8 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 13 Jan 2021 21:51:07 +0100 Subject: [PATCH] possible fix no 2 --- src/Network/Http.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Network/Http.cpp b/src/Network/Http.cpp index 4823b32..426850b 100644 --- a/src/Network/Http.cpp +++ b/src/Network/Http.cpp @@ -54,9 +54,8 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json CurlManager M; CURL* curl = M.Get(); CURLcode res; - std::string readBuffer; - readBuffer.resize(1000, 0); - + char readBuffer[5000]; + Assert(curl); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, IP.c_str()); @@ -65,7 +64,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[0]); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); res = curl_easy_perform(curl);