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)
unsigned
jitter(struct interface *ifp, int urgent)
{
unsigned interval = ifp->hello_interval;
unsigned interval = ifp->buf.flush_interval;
if(urgent)
interval = MIN(interval, 100);
interval = MIN(interval, 20);
else
interval = MIN(interval, 4000);
return roughly(interval) / 4;
interval = MIN(interval, 2000);
return roughly(interval / 2);
}
unsigned
......@@ -403,6 +403,10 @@ interface_up(struct interface *ifp, int up)
IF_CONF(ifp, update_interval) :
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 =
IF_CONF(ifp, rtt_decay) > 0 ?
IF_CONF(ifp, rtt_decay) : 42;
......
......@@ -82,6 +82,7 @@ struct buffered {
char *buf;
int len;
int size;
int flush_interval;
struct timeval timeout;
char enable_timestamps;
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