VERBOSE (morep, TRACE, PRINTF ("MOREP_Receive_timeout\n"));
- if (MOREP_list[index]->used) {
+ if ((index < 0) || (index >= MAX_MOREP_NUMBER) ||
+ (MOREP_list[index] == NULL) || (!MOREP_list[index]->used)) {
+ VERBOSE (morep, ERROR, PRINTF ("incorrect MOREP descriptor (%d)\n", index));
return -1;
}
+ VERBOSE (morep, DEBUG, PRINTF ("working with MOREP descriptor %d (%d)\n", index, MOREP_list[index]->sock));
int fid = MOREP_list[index]->sock;
fd_set rfds;
- struct timeval tv = { 0, ms };
+ struct timeval tv = { 0, ms * 1000};
FD_ZERO (&rfds);
FD_SET (fid, &rfds);
int retval = select (fid + 1, &rfds, NULL, NULL, &tv);
+ VERBOSE (morep, TRACE, PRINTF ("select: %d (%ld, %ld)\n", retval, tv.tv_sec, tv.tv_usec));
if (retval != 1) {
return retval;
}