Mercurial > hg > index.cgi
comparison src/lwwire.c @ 5:422f5e8fff85
Extend base read timeout to 100ms in spec and implementation.
Reports indicate that 10ms is too short so extending the base timeout to
100ms to compensate.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sun, 29 May 2016 21:59:29 -0600 |
parents | 56f53e48ab50 |
children | cf915ece9e48 |
comparison
equal
deleted
inserted
replaced
4:56f53e48ab50 | 5:422f5e8fff85 |
---|---|
372 return fcntl(fd, F_SETFL, flags); | 372 return fcntl(fd, F_SETFL, flags); |
373 } | 373 } |
374 | 374 |
375 /* | 375 /* |
376 Read len bytes from the input. If no bytes are available after | 376 Read len bytes from the input. If no bytes are available after |
377 10 ms, return error. | 377 100 ms, return error. |
378 | 378 |
379 This *may* allow a timeout longer than 10ms. However, it will | 379 This *may* allow a timeout longer than 10ms. However, it will |
380 eventually time out. In the worse case, it is more permissive | 380 eventually time out. In the worse case, it is more permissive |
381 than the specification. It will not time out before 10ms elapses. | 381 than the specification. It will not time out before 10ms elapses. |
382 | 382 |
439 | 439 |
440 // now wait for the descriptor to be readable | 440 // now wait for the descriptor to be readable |
441 FD_ZERO(&fdset); | 441 FD_ZERO(&fdset); |
442 FD_SET(0, &fdset); | 442 FD_SET(0, &fdset); |
443 timeout.tv_sec = 0; | 443 timeout.tv_sec = 0; |
444 timeout.tv_usec = 10000 * itimeout; | 444 timeout.tv_usec = 100000 * itimeout; |
445 | 445 |
446 rv = select(1, &fdset, NULL, NULL, &timeout); | 446 rv = select(1, &fdset, NULL, NULL, &timeout); |
447 if (rv < 0) | 447 if (rv < 0) |
448 { | 448 { |
449 // this is a last ditch effort to not break completely | 449 // this is a last ditch effort to not break completely |