From a6ac404853d107308b0ad11dbf0885c50ab11b73 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 23 Nov 2018 16:38:22 +0100 Subject: Decrease libcurl timeout from indefinite to 30 minutes --- src/imlib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/imlib.c b/src/imlib.c index 4270c4a..2f3459e 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -583,6 +583,13 @@ static char *feh_http_load_image(char *url) #ifdef DEBUG curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); #endif + /* + * Do not allow requests to take longer than 30 minutes. + * This should be sufficiently high to accomodate use cases with + * unusually high latencies, while at the sime time avoiding + * feh hanging indefinitely in unattended slideshows. + */ + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1800); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEDATA, sfp); ebuff = emalloc(CURL_ERROR_SIZE); -- cgit v1.2.3