mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Close any open sockets when reusing a curl handle and reopen the socket whenever we're retrying stratum.
This commit is contained in:
parent
81c02123f8
commit
56068d6839
6
util.c
6
util.c
@ -1428,7 +1428,8 @@ static bool setup_stratum_curl(struct pool *pool)
|
|||||||
pool->stratum_curl = curl_easy_init();
|
pool->stratum_curl = curl_easy_init();
|
||||||
if (unlikely(!pool->stratum_curl))
|
if (unlikely(!pool->stratum_curl))
|
||||||
quit(1, "Failed to curl_easy_init in initiate_stratum");
|
quit(1, "Failed to curl_easy_init in initiate_stratum");
|
||||||
}
|
} else
|
||||||
|
CLOSESOCKET(pool->sock);
|
||||||
mutex_unlock(&pool->stratum_lock);
|
mutex_unlock(&pool->stratum_lock);
|
||||||
curl = pool->stratum_curl;
|
curl = pool->stratum_curl;
|
||||||
|
|
||||||
@ -1520,11 +1521,12 @@ bool initiate_stratum(struct pool *pool)
|
|||||||
json_error_t err;
|
json_error_t err;
|
||||||
int n2size;
|
int n2size;
|
||||||
|
|
||||||
|
resend:
|
||||||
if (!setup_stratum_curl(pool))
|
if (!setup_stratum_curl(pool))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
sockd = true;
|
sockd = true;
|
||||||
resend:
|
|
||||||
if (recvd) {
|
if (recvd) {
|
||||||
/* Get rid of any crap lying around if we're resending */
|
/* Get rid of any crap lying around if we're resending */
|
||||||
clear_sock(pool);
|
clear_sock(pool);
|
||||||
|
Loading…
Reference in New Issue
Block a user