mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 10:45:36 +00:00
possibly fixes segfault issue on connect
This commit is contained in:
parent
e0b7dd76fd
commit
769c19b811
@ -30,7 +30,7 @@ static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* use
|
|||||||
return size * nmemb;
|
return size * nmemb;
|
||||||
}
|
}
|
||||||
std::string HttpRequest(const std::string& IP, int port) {
|
std::string HttpRequest(const std::string& IP, int port) {
|
||||||
static thread_local CurlManager M;
|
CurlManager M;
|
||||||
std::string readBuffer;
|
std::string readBuffer;
|
||||||
CURL* curl = M.Get();
|
CURL* curl = M.Get();
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
@ -49,9 +49,9 @@ std::string HttpRequest(const std::string& IP, int port) {
|
|||||||
|
|
||||||
std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json) {
|
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" };
|
||||||
static thread_local CurlManager M;
|
|
||||||
static std::mutex Lock;
|
static std::mutex Lock;
|
||||||
std::scoped_lock Guard(Lock);
|
std::scoped_lock Guard(Lock);
|
||||||
|
CurlManager M;
|
||||||
CURL* curl = M.Get();
|
CURL* curl = M.Get();
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
std::string readBuffer;
|
std::string readBuffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user