curl: Stop using CURLOPT_PIPEWAIT flag temporarily

We're seeing a problem in current curl when using the flag
CURLOPT_PIPEWAIT and trying to download a file from an unexistent or
unreachable server.

Easiest way to reproduce that on swupd is to disable your while you are
in the download phase of any swupd command. Without this patch swupd will
hangs and wont timeout.

The downside of removing this flag is that curl will prefer to open more connections
instead of waiting to check if it can multiplex. So it's a good thing to have
this enabled back in the future

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2019-08-20 10:48:20 -07:00
parent eda855d1ef
commit 23de8a6cec
+5 -4
View File
@@ -757,10 +757,11 @@ CURLcode swupd_curl_set_basic_options(CURL *curl, const char *url, bool fail_on_
goto exit;
}
curl_ret = curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1);
if (curl_ret != CURLE_OK && curl_ret != CURLE_UNKNOWN_OPTION) {
goto exit;
}
//TODO: Introduce code back on bug is fixed on curl
//curl_ret = curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1);
//if (curl_ret != CURLE_OK && curl_ret != CURLE_UNKNOWN_OPTION) {
// goto exit;
//}
curl_ret = curl_easy_setopt(curl, CURLOPT_USERAGENT, PACKAGE "/" VERSION);
if (curl_ret != CURLE_OK && curl_ret != CURLE_UNKNOWN_OPTION) {