summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-10 21:51:54 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-10 21:51:54 +0000
commit4d1ef3bac4ba09423a51af809ef0c9220402f050 (patch)
treec6b9dcdf2c832195ab418dcb0913ac62c3ae3b5a /desktop
parent727bbbd216ccd0f4c11164b54348a120f5311d40 (diff)
downloadnetsurf-4d1ef3bac4ba09423a51af809ef0c9220402f050.tar.gz
netsurf-4d1ef3bac4ba09423a51af809ef0c9220402f050.tar.bz2
Add support for retrying timed-out cURL fetches.
This is an attempt to amelioriate the situation found in #2384 where we see the cURL connect() failing to complete. Based on the pcap from the bug log, we believe that RISC OS is likely failing to signal the completion of the connection to cURL. As such, cURL times out. This change permits retries of timed out connections in the hope that a fresh socket FD might subsequently function correctly. The defaults chosen mean that the previous behaviour of 30 seconds before timeout is reported will remain the same, but in that time we will make 3 separate attempts to connect the socket.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/netsurf.c3
-rw-r--r--desktop/options.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 0fd7b7bbd..d6b5abe6e 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -164,6 +164,9 @@ nserror netsurf_init(const char *store_path)
LOG("Setting minimum memory cache size %zd", hlcache_parameters.llcache.limit);
}
+ /* Set up the max attempts made to fetch a timing out resource */
+ hlcache_parameters.llcache.fetch_attempts = nsoption_uint(max_retried_fetches);
+
/* image cache is 25% of total memory cache size */
image_cache_parameters.limit = (hlcache_parameters.llcache.limit * 25) / 100;
diff --git a/desktop/options.h b/desktop/options.h
index f01261ee1..e734c5294 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -208,6 +208,14 @@ NSOPTION_INTEGER(max_fetchers_per_host, 5)
*/
NSOPTION_INTEGER(max_cached_fetch_handles, 6)
+/** Number of times to retry timed-out fetches before giving up. */
+NSOPTION_UINT(max_retried_fetches, 3)
+
+/** Number of seconds to allow for a DNS-resolution+connect() before timing out
+ * the cURL socket.
+ */
+NSOPTION_UINT(curl_fetch_timeout, 10)
+
/** Suppress debug output from cURL. */
NSOPTION_BOOL(suppress_curl_debug, true)