@@ -838,6 +838,19 @@
static void
check_coarse_timers(struct context *c)
{
+#ifdef ENABLE_MANAGEMENT
+ /* The 'bytecount' command starts a timer at runtime, but it would not be
+ * processed if coarse_timer_wakeup was previously set to a higher value.
+ * Therefore, if the command has arrived, we reset coarse_timer_wakeup in
+ * to order to update it accordingly.
+ */
+ if (management && management->connection.bytecount_interval_changed)
+ {
+ reset_coarse_timers(c);
+ management->connection.bytecount_interval_changed = false;
+ }
+#endif /* ENABLE_MANAGEMENT */
+
if (now < c->c2.coarse_timer_wakeup)
{
context_reschedule_sec(c, c->c2.coarse_timer_wakeup - now);
@@ -503,6 +503,7 @@
man->connection.bytecount_update_seconds = 0;
event_timeout_clear(&man->connection.bytecount_update_interval);
}
+ man->connection.bytecount_interval_changed = true;
msg(M_CLIENT, "SUCCESS: bytecount interval changed");
}
@@ -318,6 +318,7 @@
bool state_realtime;
bool log_realtime;
bool echo_realtime;
+ bool bytecount_interval_changed;
int bytecount_update_seconds;
struct event_timeout bytecount_update_interval;