From 426f72dec7bcada1f417fbdb8b6b87123716cb59 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 16 Aug 2011 10:27:19 +1000 Subject: [PATCH] As we have keepalives now, blaming network flakiness on timeouts appears to have been wrong. Set a timeout for longpoll to 1 hour, and most other network connectivity to 1 minute. --- util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 7b04c6ba..563b5f67 100644 --- a/util.c +++ b/util.c @@ -311,6 +311,7 @@ json_t *json_rpc_call(CURL *curl, const char *url, struct curl_slist *headers = NULL; char len_hdr[64], user_agent_hdr[128]; char curl_err_str[CURL_ERROR_SIZE]; + long timeout = longpoll ? (60 * 60) : 60; struct header_info hi = { }; bool probing = false; @@ -318,9 +319,10 @@ json_t *json_rpc_call(CURL *curl, const char *url, if (probe) { probing = ((want_longpoll && !have_longpoll) || !pool->probed); - /* Probe for only 14 seconds */ - curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15); + /* Probe for only 15 seconds */ + timeout = 15; } + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); if (opt_protocol) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);