static gboolean throttle_timer_cb(gpointer data) { static bool send_updates = FALSE; static enum throttle_state_e last = -1; enum throttle_state_e now = throttle_none; if(send_updates == FALSE) { /* Optimize for the true case */ if(compare_version(fsa_our_dc_version, "3.0.8") < 0) { crm_trace("DC version %s doesn't support throttling", fsa_our_dc_version); } else { send_updates = TRUE; } } if(send_updates) { now = throttle_mode(); } if(send_updates && now != last) { crm_debug("New throttle mode: %.4x (was %.4x)", now, last); throttle_send_command(now); last = now; } return TRUE; }
static gboolean throttle_timer_cb(gpointer data) { static bool send_updates = FALSE; enum throttle_state_e now = throttle_none; if(send_updates) { now = throttle_mode(); throttle_send_command(now); } else if(compare_version(fsa_our_dc_version, "3.0.8") < 0) { /* Optimize for the true case */ crm_trace("DC version %s doesn't support throttling", fsa_our_dc_version); } else { send_updates = TRUE; now = throttle_mode(); throttle_send_command(now); } return TRUE; }