From: Lennart Poettering Date: Mon, 20 Jan 2020 21:02:14 +0000 (+0100) Subject: import: put a time-out on downloads X-Git-Tag: v245-rc1~88^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d076f9fd56c9791457c2a2ea6603c1fe94966593;p=thirdparty%2Fsystemd.git import: put a time-out on downloads Let's abort downloads when they are stuck by setting a download speed threshold (as suggested in the CURL docs) Fixes: #14215 --- diff --git a/src/import/curl-util.c b/src/import/curl-util.c index 96cf696652f..eea5ca395f8 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -247,6 +247,12 @@ int curl_glue_make(CURL **ret, const char *url, void *userdata) { if (curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) return -EIO; + if (curl_easy_setopt(c, CURLOPT_LOW_SPEED_TIME, 60L) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(c, CURLOPT_LOW_SPEED_LIMIT, 30L) != CURLE_OK) + return -EIO; + *ret = TAKE_PTR(c); return 0; }