From 8593aeb21d51ff955b807ce3a204093e2e485ad8 Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:53:42 +0100 Subject: [PATCH] Force IPv4 --- src/Http.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Http.cpp b/src/Http.cpp index 03a31e1..0aba663 100644 --- a/src/Http.cpp +++ b/src/Http.cpp @@ -44,6 +44,7 @@ std::string Http::GET(const std::string& url, unsigned int* status) { CURLcode res; char errbuf[CURL_ERROR_SIZE]; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&Ret); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); // seconds @@ -75,6 +76,7 @@ std::string Http::POST(const std::string& url, const std::string& body, const st CURLcode res; char errbuf[CURL_ERROR_SIZE]; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&Ret); curl_easy_setopt(curl, CURLOPT_POST, 1);