Browse Source

Check for a restart before a timeout in message parsing code in avalon.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
53a047d007
  1. 18
      driver-avalon.c

18
driver-avalon.c

@ -234,23 +234,23 @@ static int avalon_gets(int fd, uint8_t *buf, int read_count, @@ -234,23 +234,23 @@ static int avalon_gets(int fd, uint8_t *buf, int read_count,
continue;
}
rc++;
if (rc >= read_count) {
if (thr && thr->work_restart) {
if (opt_debug) {
applog(LOG_WARNING,
"Avalon: No data in %.2f seconds",
(float)rc/(float)AVALON_TIME_FACTOR);
"Avalon: Work restart at %.2f seconds",
(float)(rc)/(float)AVALON_TIME_FACTOR);
}
return AVA_GETS_TIMEOUT;
return AVA_GETS_RESTART;
}
if (thr && thr->work_restart) {
rc++;
if (rc >= read_count) {
if (opt_debug) {
applog(LOG_WARNING,
"Avalon: Work restart at %.2f seconds",
(float)(rc)/(float)AVALON_TIME_FACTOR);
"Avalon: No data in %.2f seconds",
(float)rc/(float)AVALON_TIME_FACTOR);
}
return AVA_GETS_RESTART;
return AVA_GETS_TIMEOUT;
}
}
}

Loading…
Cancel
Save