diff options
author | Martin Willi <martin@revosec.ch> | 2013-03-19 15:17:41 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-03-19 15:48:27 +0100 |
commit | 2071dd63d6812392a4b939cd592826e94aaf5341 (patch) | |
tree | 166e905f0016eaf4cda537141cb0bc150e9f6404 /src/libcharon/plugins/ha | |
parent | 5cf3afd1fa73e584c4cefeb1fa4e9e65d5c4e363 (diff) | |
download | strongswan-2071dd63d6812392a4b939cd592826e94aaf5341.tar.bz2 strongswan-2071dd63d6812392a4b939cd592826e94aaf5341.tar.xz |
Fix scheduling of heartbeat sending in HA plugin
e0efd7c1 switches to automated job rescheduling for HA heartbeat. However,
send_status() is initially called directly, which will not reschedule the job
as required.
Diffstat (limited to 'src/libcharon/plugins/ha')
-rw-r--r-- | src/libcharon/plugins/ha/ha_segments.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libcharon/plugins/ha/ha_segments.c b/src/libcharon/plugins/ha/ha_segments.c index 688e09bdc..6c21e8981 100644 --- a/src/libcharon/plugins/ha/ha_segments.c +++ b/src/libcharon/plugins/ha/ha_segments.c @@ -348,6 +348,16 @@ static job_requeue_t send_status(private_ha_segments_t *this) return JOB_RESCHEDULE_MS(this->heartbeat_delay); } +/** + * Start the heartbeat sending task + */ +static void start_heartbeat(private_ha_segments_t *this) +{ + lib->processor->queue_job(lib->processor, + (job_t*)callback_job_create_with_prio((callback_job_cb_t)send_status, + this, NULL, (callback_job_cancel_t)return_false, JOB_PRIO_CRITICAL)); +} + METHOD(ha_segments_t, is_active, bool, private_ha_segments_t *this, u_int segment) { @@ -401,10 +411,9 @@ ha_segments_t *ha_segments_create(ha_socket_t *socket, ha_kernel_t *kernel, { DBG1(DBG_CFG, "starting HA heartbeat, delay %dms, timeout %dms", this->heartbeat_delay, this->heartbeat_timeout); - send_status(this); + start_heartbeat(this); start_watchdog(this); } return &this->public; } - |