From a5f9eafe23435988ecdbf20023a17e3cdb055401 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 11 Sep 2026 21:17:01 +0300 Subject: [PATCH] add HttpRequest::timeoutMs --- src/network/Curl.cpp | 3 +++ src/network/commons.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/network/Curl.cpp b/src/network/Curl.cpp index 42d4817c8..fd1b0ad14 100644 --- a/src/network/Curl.cpp +++ b/src/network/Curl.cpp @@ -82,6 +82,9 @@ public: curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &entry->buffer); curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.81.0"); + if (request.timeoutMs > 0) { + curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, request.timeoutMs); + } #ifndef NDEBUG // curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); #endif diff --git a/src/network/commons.hpp b/src/network/commons.hpp index 46745bfbb..79e4bdb9d 100644 --- a/src/network/commons.hpp +++ b/src/network/commons.hpp @@ -28,6 +28,7 @@ namespace network { bool followLocation = false; bool verifySSL = true; long maxSize = -1; + long timeoutMs = 0; }; class Requests {