mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
There should be no error response code with return value 0 in recv_line.
This commit is contained in:
parent
b615502b2b
commit
181cb1635f
10
util.c
10
util.c
@ -1104,19 +1104,17 @@ char *recv_line(struct pool *pool)
|
|||||||
|
|
||||||
memset(s, 0, RBUFSIZE);
|
memset(s, 0, RBUFSIZE);
|
||||||
n = recv(pool->sock, s, RECVSIZE, 0);
|
n = recv(pool->sock, s, RECVSIZE, 0);
|
||||||
if (n < 1) {
|
if (!n) {
|
||||||
if (errno != EAGAIN && errno != EWOULDBLOCK) {
|
|
||||||
if (n == 0)
|
|
||||||
ret = RECV_CLOSED;
|
ret = RECV_CLOSED;
|
||||||
else
|
break;
|
||||||
|
}
|
||||||
|
if (n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||||
ret = RECV_RECVFAIL;
|
ret = RECV_RECVFAIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
slen = strlen(s);
|
slen = strlen(s);
|
||||||
recalloc_sock(pool, slen);
|
recalloc_sock(pool, slen);
|
||||||
strcat(pool->sockbuf, s);
|
strcat(pool->sockbuf, s);
|
||||||
}
|
|
||||||
cgtime(&now);
|
cgtime(&now);
|
||||||
} while (tdiff(&now, &rstart) < 60 && !strstr(pool->sockbuf, "\n"));
|
} while (tdiff(&now, &rstart) < 60 && !strstr(pool->sockbuf, "\n"));
|
||||||
mutex_unlock(&pool->stratum_lock);
|
mutex_unlock(&pool->stratum_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user