Event cycle may took too much time and trigger next timer events, so
avoid cycling between timer and event cycles inside the loop cycle.
DBG("BGP: Keepalive timer\n");
bgp_schedule_packet(conn, PKT_KEEPALIVE);
+
+ /* Kick TX a bit faster */
+ if (ev_active(conn->tx_ev))
+ ev_run(conn->tx_ev);
}
static void
for(;;)
{
events = ev_run_list(&global_event_list);
+ timers:
update_times();
tout = tm_first_shot();
if (tout <= now)
{
tm_shot();
- continue;
+ goto timers;
}
poll_tout = (events ? 0 : MIN(tout - now, 3)) * 1000; /* Time in milliseconds */