mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
refactor: set CURLOPT_MAXREDIRS once (#7233)
This commit is contained in:
@@ -522,7 +522,7 @@ public:
|
|||||||
(void)curl_easy_setopt(e, CURLOPT_AUTOREFERER, 1L);
|
(void)curl_easy_setopt(e, CURLOPT_AUTOREFERER, 1L);
|
||||||
(void)curl_easy_setopt(e, CURLOPT_ACCEPT_ENCODING, "");
|
(void)curl_easy_setopt(e, CURLOPT_ACCEPT_ENCODING, "");
|
||||||
(void)curl_easy_setopt(e, CURLOPT_FOLLOWLOCATION, 1L);
|
(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_NOSIGNAL, 1L);
|
||||||
(void)curl_easy_setopt(e, CURLOPT_PRIVATE, &task);
|
(void)curl_easy_setopt(e, CURLOPT_PRIVATE, &task);
|
||||||
(void)curl_easy_setopt(e, CURLOPT_IPRESOLVE, task.ipProtocol());
|
(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_VERBOSE, curl_verbose ? 1L : 0L);
|
||||||
(void)curl_easy_setopt(e, CURLOPT_WRITEDATA, &task);
|
(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_WRITEFUNCTION, &tr_web::Impl::onDataReceived);
|
||||||
(void)curl_easy_setopt(e, CURLOPT_MAXREDIRS, MaxRedirects);
|
|
||||||
|
|
||||||
if (auto const addrstr = task.bind_address(); addrstr)
|
if (auto const addrstr = task.bind_address(); addrstr)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user