1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-10 04:31:03 +00:00

Only loop once through avalon_parse_results, but do so after timeouts as well.

This commit is contained in:
Con Kolivas 2013-05-26 01:33:32 +10:00
parent 1f08809a7f
commit be3224f933

View File

@ -685,6 +685,9 @@ static void *avalon_get_results(void *userdata)
ssize_t ret;
fd_set rd;
if (offset >= (int)AVALON_READ_SIZE)
avalon_parse_results(avalon, info, thr, readbuf, &offset);
if (unlikely(offset + rsize >= AVALON_READBUF_SIZE)) {
/* This should never happen */
applog(LOG_ERR, "Avalon readbuf overflow, resetting buffer");
@ -715,9 +718,6 @@ static void *avalon_get_results(void *userdata)
memcpy(&readbuf[offset], buf, ret);
offset += ret;
while (offset >= (int)AVALON_READ_SIZE)
avalon_parse_results(avalon, info, thr, readbuf, &offset);
}
return NULL;
}