From 769c19b8112e69c2043571004b0ffd111a3b21c2 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 13 Jan 2021 21:34:09 +0100 Subject: [PATCH] possibly fixes segfault issue on connect --- src/Network/Http.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Network/Http.cpp b/src/Network/Http.cpp index 7a605f9..7a98050 100644 --- a/src/Network/Http.cpp +++ b/src/Network/Http.cpp @@ -30,7 +30,7 @@ static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* use return size * nmemb; } std::string HttpRequest(const std::string& IP, int port) { - static thread_local CurlManager M; + CurlManager M; std::string readBuffer; CURL* curl = M.Get(); 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) { auto header = curl_slist { (char*)"Content-Type: application/json" }; - static thread_local CurlManager M; static std::mutex Lock; std::scoped_lock Guard(Lock); + CurlManager M; CURL* curl = M.Get(); CURLcode res; std::string readBuffer;