|
|
@ -963,7 +963,7 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len) |
|
|
|
return SEND_SELECTFAIL; |
|
|
|
return SEND_SELECTFAIL; |
|
|
|
sent = send(pool->sock, s + ssent, len, 0); |
|
|
|
sent = send(pool->sock, s + ssent, len, 0); |
|
|
|
if (sent < 0) { |
|
|
|
if (sent < 0) { |
|
|
|
if (errno != EAGAIN && errno != EWOULDBLOCK) |
|
|
|
if (!sock_blocks()) |
|
|
|
return SEND_SENDFAIL; |
|
|
|
return SEND_SENDFAIL; |
|
|
|
sent = 0; |
|
|
|
sent = 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -1108,13 +1108,16 @@ char *recv_line(struct pool *pool) |
|
|
|
ret = RECV_CLOSED; |
|
|
|
ret = RECV_CLOSED; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) { |
|
|
|
if (n < 0) { |
|
|
|
ret = RECV_RECVFAIL; |
|
|
|
if (!sock_blocks()) { |
|
|
|
break; |
|
|
|
ret = RECV_RECVFAIL; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
slen = strlen(s); |
|
|
|
|
|
|
|
recalloc_sock(pool, slen); |
|
|
|
|
|
|
|
strcat(pool->sockbuf, s); |
|
|
|
} |
|
|
|
} |
|
|
|
slen = strlen(s); |
|
|
|
|
|
|
|
recalloc_sock(pool, slen); |
|
|
|
|
|
|
|
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); |
|
|
|