Browse Source

Use the pool sock value directly in the stratum thread in case it changes after reconnecting.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
0f1f2a62a6
  1. 13
      cgminer.c

13
cgminer.c

@ -3964,18 +3964,17 @@ out_unlock:
static void *stratum_thread(void *userdata) static void *stratum_thread(void *userdata)
{ {
struct pool *pool = (struct pool *)userdata; struct pool *pool = (struct pool *)userdata;
SOCKETTYPE sock = pool->sock;
fd_set rd;
pthread_detach(pthread_self()); pthread_detach(pthread_self());
FD_ZERO(&rd);
FD_SET(sock, &rd);
while (42) { while (42) {
fd_set rd;
char *s; char *s;
if (select(sock + 1, &rd, NULL, NULL, NULL) < 0) { FD_ZERO(&rd);
FD_SET(pool->sock, &rd);
if (select(pool->sock + 1, &rd, NULL, NULL, NULL) < 0) {
pool->stratum_active = pool->stratum_auth = false; pool->stratum_active = pool->stratum_auth = false;
applog(LOG_WARNING, "Stratum connection to pool %d interrupted", pool->pool_no); applog(LOG_WARNING, "Stratum connection to pool %d interrupted", pool->pool_no);
pool->getfail_occasions++; pool->getfail_occasions++;
@ -3984,7 +3983,7 @@ static void *stratum_thread(void *userdata)
break; break;
} }
} }
s = recv_line(sock); s = recv_line(pool->sock);
if (unlikely(!s)) if (unlikely(!s))
continue; continue;
if (!parse_stratum(pool, s)) /* Create message queues here */ if (!parse_stratum(pool, s)) /* Create message queues here */

Loading…
Cancel
Save