From 23de8a6cec308352e41afec128ad727b492459fe Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Mon, 19 Aug 2019 12:36:05 -0700 Subject: [PATCH] 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 --- src/curl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/curl.c b/src/curl.c index 6b739888..2e1dd5e4 100644 --- a/src/curl.c +++ b/src/curl.c @@ -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) {