Commit c90a2172 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Apply jitter before sending the first message.

parent 1a2701ba
...@@ -515,12 +515,15 @@ main(int argc, char **argv) ...@@ -515,12 +515,15 @@ main(int argc, char **argv)
for(i = 0; i < numnets; i++) { for(i = 0; i < numnets; i++) {
if(!nets[i].up) if(!nets[i].up)
continue; continue;
/* Apply jitter before we send the first message. */
usleep(5000 + random() % 10000);
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
send_hello(&nets[i]); send_hello(&nets[i]);
send_self_update(&nets[i], 0); send_self_update(&nets[i], 0);
/* Make sure the update is sent before the request. */
flushupdates();
send_request(&nets[i], NULL, 0, 0, 0, 0); send_request(&nets[i], NULL, 0, 0, 0, 0);
flushbuf(&nets[i]); flushbuf(&nets[i]);
usleep(5000 + random() % 10000);
} }
debugf("Entering main loop.\n"); debugf("Entering main loop.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment