Commit 024d2db6 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek Committed by Juliusz Chroboczek

Add field flush_interval to struct buffered.

parent 7f4bba93
...@@ -132,12 +132,12 @@ flush_interface(char *ifname) ...@@ -132,12 +132,12 @@ flush_interface(char *ifname)
unsigned unsigned
jitter(struct interface *ifp, int urgent) jitter(struct interface *ifp, int urgent)
{ {
unsigned interval = ifp->hello_interval; unsigned interval = ifp->buf.flush_interval;
if(urgent) if(urgent)
interval = MIN(interval, 100); interval = MIN(interval, 20);
else else
interval = MIN(interval, 4000); interval = MIN(interval, 2000);
return roughly(interval) / 4; return roughly(interval / 2);
} }
unsigned unsigned
...@@ -403,6 +403,10 @@ interface_up(struct interface *ifp, int up) ...@@ -403,6 +403,10 @@ interface_up(struct interface *ifp, int up)
IF_CONF(ifp, update_interval) : IF_CONF(ifp, update_interval) :
ifp->hello_interval * 4; ifp->hello_interval * 4;
/* This must be no more than half the Hello interval, or else
Hellos will arrive late. */
ifp->buf.flush_interval = ifp->hello_interval / 2;
ifp->rtt_decay = ifp->rtt_decay =
IF_CONF(ifp, rtt_decay) > 0 ? IF_CONF(ifp, rtt_decay) > 0 ?
IF_CONF(ifp, rtt_decay) : 42; IF_CONF(ifp, rtt_decay) : 42;
......
...@@ -82,6 +82,7 @@ struct buffered { ...@@ -82,6 +82,7 @@ struct buffered {
char *buf; char *buf;
int len; int len;
int size; int size;
int flush_interval;
struct timeval timeout; struct timeval timeout;
char enable_timestamps; char enable_timestamps;
char have_id; char have_id;
......
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