mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Recv() should all be non-blocking for raw sockets in stratum.
This commit is contained in:
parent
cf80fe4a63
commit
6e969e93e2
6
util.c
6
util.c
@ -1033,13 +1033,11 @@ static void clear_sock(struct pool *pool)
|
||||
{
|
||||
ssize_t n;
|
||||
|
||||
if (socket_full(pool, false)) {
|
||||
mutex_lock(&pool->stratum_lock);
|
||||
do {
|
||||
n = recv(pool->sock, pool->sockbuf, RECVSIZE, 0);
|
||||
n = recv(pool->sock, pool->sockbuf, RECVSIZE, MSG_DONTWAIT);
|
||||
} while (n > 0);
|
||||
mutex_unlock(&pool->stratum_lock);
|
||||
}
|
||||
|
||||
clear_sockbuf(pool);
|
||||
}
|
||||
@ -1095,7 +1093,7 @@ char *recv_line(struct pool *pool)
|
||||
ssize_t n;
|
||||
|
||||
memset(s, 0, RBUFSIZE);
|
||||
n = recv(pool->sock, s, RECVSIZE, 0);
|
||||
n = recv(pool->sock, s, RECVSIZE, MSG_DONTWAIT);
|
||||
if (!n) {
|
||||
ret = RECV_CLOSED;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user