1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

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
This commit is contained in:
Lennart Poettering 2020-01-20 22:02:14 +01:00
parent 137c6c6b36
commit d076f9fd56

View File

@ -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;
}