Skip to content

Commit

Permalink
change connection timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Dec 13, 2016
1 parent 579f8de commit 6f4a7a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ccminer.cpp
Expand Up @@ -137,7 +137,7 @@ static bool opt_background = false;
bool opt_quiet = false;
static int opt_retries = -1;
static int opt_fail_pause = 30;
int opt_timeout = 270;
int opt_timeout = 20;
static int opt_scantime = 25;
static json_t *opt_config = nullptr;
static const bool opt_time = true;
Expand Down Expand Up @@ -2159,7 +2159,7 @@ static void *stratum_thread(void *userdata)
pthread_mutex_unlock(&g_work_lock);
}

if(!stratum_socket_full(&stratum, 120))
if(!stratum_socket_full(&stratum, 10))
{
applog(LOG_ERR, "Stratum connection timed out");
s = NULL;
Expand Down
4 changes: 2 additions & 2 deletions util.cpp
Expand Up @@ -412,7 +412,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
char* httpdata;
char len_hdr[64], hashrate_hdr[64];
char curl_err_str[CURL_ERROR_SIZE] = { 0 };
long timeout = longpoll ? opt_timeout : 30;
long timeout = longpoll ? 30 : opt_timeout;
struct header_info hi = { 0 };
bool lp_scanning = longpoll_scan && !have_longpoll;

Expand Down Expand Up @@ -992,7 +992,7 @@ bool stratum_connect(struct stratum_ctx *sctx, const char *url)
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_URL, sctx->curl_url);
curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, opt_timeout);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sctx->curl_err_str);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1);
Expand Down

0 comments on commit 6f4a7a6

Please sign in to comment.