possible fix no 2

This commit is contained in:
Lion Kortlepel 2021-01-13 21:51:07 +01:00
parent c387cc3610
commit 2571cb1478

View File

@ -54,8 +54,7 @@ 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) {
@ -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);