Commit 7a32c1fb authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use delay_jitter in schedule*.

parent 917e8722
...@@ -482,9 +482,7 @@ schedule_flush(struct network *net) ...@@ -482,9 +482,7 @@ schedule_flush(struct network *net)
if(net->flush_timeout.tv_sec != 0 && if(net->flush_timeout.tv_sec != 0 &&
timeval_minus_msec(&net->flush_timeout, &now) < msecs) timeval_minus_msec(&net->flush_timeout, &now) < msecs)
return; return;
net->flush_timeout.tv_usec = (now.tv_usec + msecs * 1000) % 1000000; delay_jitter(&net->flush_timeout, msecs);
net->flush_timeout.tv_sec =
now.tv_sec + (now.tv_usec / 1000 + msecs) / 1000;
} }
static void static void
...@@ -495,9 +493,7 @@ schedule_flush_now(struct network *net) ...@@ -495,9 +493,7 @@ schedule_flush_now(struct network *net)
if(net->flush_timeout.tv_sec != 0 && if(net->flush_timeout.tv_sec != 0 &&
timeval_minus_msec(&net->flush_timeout, &now) < msecs) timeval_minus_msec(&net->flush_timeout, &now) < msecs)
return; return;
net->flush_timeout.tv_usec = (now.tv_usec + msecs * 1000) % 1000000; delay_jitter(&net->flush_timeout, msecs);
net->flush_timeout.tv_sec =
now.tv_sec + (now.tv_usec / 1000 + msecs) / 1000;
} }
static void static void
...@@ -927,10 +923,7 @@ schedule_update_flush(struct network *net, int urgent) ...@@ -927,10 +923,7 @@ schedule_update_flush(struct network *net, int urgent)
if(net->update_flush_timeout.tv_sec != 0 && if(net->update_flush_timeout.tv_sec != 0 &&
timeval_minus_msec(&net->update_flush_timeout, &now) < msecs) timeval_minus_msec(&net->update_flush_timeout, &now) < msecs)
return; return;
net->update_flush_timeout.tv_usec = delay_jitter(&net->update_flush_timeout, msecs);
(now.tv_usec + msecs * 1000) % 1000000;
net->update_flush_timeout.tv_sec =
now.tv_sec + (now.tv_usec / 1000 + msecs) / 1000;
} }
static void static void
......
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