Browse Source

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.
nfactor-troky
Con Kolivas 13 years ago
parent
commit
426f72dec7
  1. 6
      util.c

6
util.c

@ -311,6 +311,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
struct curl_slist *headers = NULL; struct curl_slist *headers = NULL;
char len_hdr[64], user_agent_hdr[128]; char len_hdr[64], user_agent_hdr[128];
char curl_err_str[CURL_ERROR_SIZE]; char curl_err_str[CURL_ERROR_SIZE];
long timeout = longpoll ? (60 * 60) : 60;
struct header_info hi = { }; struct header_info hi = { };
bool probing = false; bool probing = false;
@ -318,9 +319,10 @@ json_t *json_rpc_call(CURL *curl, const char *url,
if (probe) { if (probe) {
probing = ((want_longpoll && !have_longpoll) || !pool->probed); probing = ((want_longpoll && !have_longpoll) || !pool->probed);
/* Probe for only 14 seconds */ /* Probe for only 15 seconds */
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15); timeout = 15;
} }
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
if (opt_protocol) if (opt_protocol)
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);

Loading…
Cancel
Save