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

Set the lp_sent bool earlier to minimise the number of extra longpolls sent out.

This commit is contained in:
Con Kolivas 2012-02-20 08:24:41 +11:00
parent 3cdac04f4f
commit fe4b5e1fc6
2 changed files with 2 additions and 3 deletions

View File

@ -1593,6 +1593,7 @@ static bool get_upstream_work(struct work *work, bool lagging)
/* If this is the current pool and supports longpoll but has not sent
* a longpoll, send one now */
if (unlikely(pool == current_pool() && !pool->is_lp && pool->hdr_path && !pool->lp_sent)) {
pool->lp_sent = true;
req_longpoll = true;
url = pool->lp_url;
}

4
util.c
View File

@ -301,12 +301,10 @@ json_t *json_rpc_call(CURL *curl, const char *url,
curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
}
if (longpoll) {
pool->lp_sent = true;
#ifdef CURL_HAS_SOCKOPT
if (longpoll)
curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, json_rpc_call_sockopt_cb);
#endif
}
curl_easy_setopt(curl, CURLOPT_POST, 1);
if (opt_protocol)