Slightly randomize all timeouts.

This commit is contained in:
Guus Sliepen 2012-10-21 17:45:16 +02:00
parent 717ea66d7b
commit edc08b73a9
6 changed files with 11 additions and 11 deletions

View file

@ -180,7 +180,7 @@ bool seen_request(const char *request) {
new->request = xstrdup(request);
new->firstseen = time(NULL);
splay_insert(past_request_tree, new);
event_add(&past_request_event, &(struct timeval){10, 0});
event_add(&past_request_event, &(struct timeval){10, rand() % 100000});
return false;
}
}
@ -201,7 +201,7 @@ static void age_past_requests(int fd, short events, void *data) {
deleted, left);
if(left)
event_add(&past_request_event, &(struct timeval){10, 0});
event_add(&past_request_event, &(struct timeval){10, rand() % 100000});
}
void init_requests(void) {