Optimise handling of select() returning <= 0.
Before, we immediately retried select() if it returned -1 and errno is EAGAIN or EINTR, and if it returned 0 it would check for network events even if we know there are none. Now, if -1 or 0 is returned we skip checking network events, but we do check for timer and signal events.
This commit is contained in:
parent
51099658c9
commit
b1945f70fe
1 changed files with 2 additions and 3 deletions
|
@ -374,11 +374,10 @@ int main_loop(void) {
|
|||
dump_connections();
|
||||
return 1;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
check_network_activity(&readset, &writeset);
|
||||
if(r > 0)
|
||||
check_network_activity(&readset, &writeset);
|
||||
|
||||
if(do_purge) {
|
||||
purge();
|
||||
|
|
Loading…
Reference in a new issue