+ curl_easy_setopt(curl, CURLOPT_USERAGENT,
+ _config->Find("Acquire::https::User-Agent",
+ _config->Find("Acquire::http::User-Agent",
+ "Debian APT-CURL/1.0 ("VERSION")").c_str()).c_str());
+
+ // set timeout
+ int timeout = _config->FindI("Acquire::https::Timeout",
+ _config->FindI("Acquire::http::Timeout",120));
+ curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, timeout);
+ //set really low lowspeed timeout (see #497983)
+ curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, DL_MIN_SPEED);
+ curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, timeout);
+
+ // set redirect options and default to 10 redirects
+ bool AllowRedirect = _config->FindB("Acquire::https::AllowRedirect",
+ _config->FindB("Acquire::http::AllowRedirect",true));
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, AllowRedirect);
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10);