From 6bf62959b48291e797d3bbcde7b2edfc79adf1c1 Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Thu, 7 Nov 2024 04:36:34 +0800 Subject: [PATCH] refactor: set `CURLOPT_MAXREDIRS` once (#7233) --- libtransmission/web.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libtransmission/web.cc b/libtransmission/web.cc index 9354cc44e..94f260742 100644 --- a/libtransmission/web.cc +++ b/libtransmission/web.cc @@ -522,7 +522,7 @@ public: (void)curl_easy_setopt(e, CURLOPT_AUTOREFERER, 1L); (void)curl_easy_setopt(e, CURLOPT_ACCEPT_ENCODING, ""); (void)curl_easy_setopt(e, CURLOPT_FOLLOWLOCATION, 1L); - (void)curl_easy_setopt(e, CURLOPT_MAXREDIRS, -1L); + (void)curl_easy_setopt(e, CURLOPT_MAXREDIRS, MaxRedirects); (void)curl_easy_setopt(e, CURLOPT_NOSIGNAL, 1L); (void)curl_easy_setopt(e, CURLOPT_PRIVATE, &task); (void)curl_easy_setopt(e, CURLOPT_IPRESOLVE, task.ipProtocol()); @@ -576,7 +576,6 @@ public: (void)curl_easy_setopt(e, CURLOPT_VERBOSE, curl_verbose ? 1L : 0L); (void)curl_easy_setopt(e, CURLOPT_WRITEDATA, &task); (void)curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, &tr_web::Impl::onDataReceived); - (void)curl_easy_setopt(e, CURLOPT_MAXREDIRS, MaxRedirects); if (auto const addrstr = task.bind_address(); addrstr) {