mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-17 17:30:55 +00:00
possible fix no 2
This commit is contained in:
@@ -54,9 +54,8 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json
|
|||||||
CurlManager M;
|
CurlManager M;
|
||||||
CURL* curl = M.Get();
|
CURL* curl = M.Get();
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
std::string readBuffer;
|
char readBuffer[5000];
|
||||||
readBuffer.resize(1000, 0);
|
|
||||||
|
|
||||||
Assert(curl);
|
Assert(curl);
|
||||||
if (curl) {
|
if (curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
|
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_POSTFIELDSIZE, Fields.size());
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, Fields.c_str());
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, Fields.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
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_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5);
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5);
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|||||||
Reference in New Issue
Block a user