1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Fail on select() failing in stratum thread without needing to attempt recv_line.

This commit is contained in:
Con Kolivas 2012-10-28 19:58:35 +11:00
parent 843fa3397e
commit d92609e665

View File

@ -4333,8 +4333,10 @@ static void *stratum_thread(void *userdata)
* every minute so if we fail to receive any for 90 seconds we * every minute so if we fail to receive any for 90 seconds we
* assume the connection has been dropped and treat this pool * assume the connection has been dropped and treat this pool
* as dead */ * as dead */
select(pool->sock + 1, &rd, NULL, NULL, &timeout); if (unlikely(select(pool->sock + 1, &rd, NULL, NULL, &timeout) < 1))
s = recv_line(pool); s = NULL;
else
s = recv_line(pool);
if (!s) { if (!s) {
applog(LOG_INFO, "Stratum connection to pool %d interrupted", pool->pool_no); applog(LOG_INFO, "Stratum connection to pool %d interrupted", pool->pool_no);
pool->getfail_occasions++; pool->getfail_occasions++;