mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 14:04:25 +00:00
Use the raw send() command instead of curl_easy_send since curl raw socket usage introduces random bugs on windows.
This commit is contained in:
parent
f66d59df03
commit
2274af6a05
10
util.c
10
util.c
@ -889,8 +889,7 @@ static bool __stratum_send(struct pool *pool, char *s, ssize_t len)
|
|||||||
|
|
||||||
while (len > 0 ) {
|
while (len > 0 ) {
|
||||||
struct timeval timeout = {0, 0};
|
struct timeval timeout = {0, 0};
|
||||||
size_t sent = 0;
|
ssize_t sent;
|
||||||
CURLcode rc;
|
|
||||||
fd_set wd;
|
fd_set wd;
|
||||||
|
|
||||||
FD_ZERO(&wd);
|
FD_ZERO(&wd);
|
||||||
@ -899,11 +898,14 @@ static bool __stratum_send(struct pool *pool, char *s, ssize_t len)
|
|||||||
applog(LOG_DEBUG, "Write select failed on pool %d sock", pool->pool_no);
|
applog(LOG_DEBUG, "Write select failed on pool %d sock", pool->pool_no);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
rc = curl_easy_send(pool->stratum_curl, s + ssent, len, &sent);
|
sent = send(pool->sock, s + ssent, len, 0);
|
||||||
if (rc != CURLE_OK) {
|
if (sent < 0) {
|
||||||
|
if (errno != EAGAIN) {
|
||||||
applog(LOG_DEBUG, "Failed to curl_easy_send in stratum_send");
|
applog(LOG_DEBUG, "Failed to curl_easy_send in stratum_send");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
sent = 0;
|
||||||
|
}
|
||||||
ssent += sent;
|
ssent += sent;
|
||||||
len -= ssent;
|
len -= ssent;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user