Commit 787dd794 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix jitter computation in delay_jitter.

parent 2b5685c6
...@@ -130,7 +130,7 @@ void ...@@ -130,7 +130,7 @@ void
delay_jitter(struct timeval *time, struct timeval *timeout, int msecs) delay_jitter(struct timeval *time, struct timeval *timeout, int msecs)
{ {
int delay; int delay;
delay = msecs * 2 / 3 + random() % MAX(msecs / 3, 10); delay = msecs * 2 / 3 + random() % (msecs * 2 / 3);
*time = now; *time = now;
timeval_plus_msec(timeout, &now, delay); timeval_plus_msec(timeout, &now, delay);
......
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