summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-23 16:38:22 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-23 16:38:22 +0100
commita6ac404853d107308b0ad11dbf0885c50ab11b73 (patch)
treea9892894cf7d8d0badc0a58b420894a851bb5f69 /src
parent6ce29720a12026ca516a0314226353121d3e1b14 (diff)
Decrease libcurl timeout from indefinite to 30 minutes
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c7
1 files changed, 7 insertions, 0 deletions
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);