1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

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.
This commit is contained in:
Con Kolivas 2011-08-16 10:27:19 +10:00
parent c53a7b0d2d
commit 426f72dec7

6
util.c
View File

@ -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);