If controller operations have a callback, don't succeed before hook gets called

This commit is contained in:
Martin Willi
2013-03-07 12:17:01 +01:00
parent 5807f9cfcd
commit 83e2c81924
+9 -1
View File
@@ -362,8 +362,11 @@ METHOD(job_t, initiate_execute, job_requeue_t,
peer_cfg->destroy(peer_cfg); peer_cfg->destroy(peer_cfg);
if (ike_sa->initiate(ike_sa, listener->child_cfg, 0, NULL, NULL) == SUCCESS) if (ike_sa->initiate(ike_sa, listener->child_cfg, 0, NULL, NULL) == SUCCESS)
{
if (!listener->logger.callback)
{ {
listener->status = SUCCESS; listener->status = SUCCESS;
}
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
} }
else else
@@ -453,8 +456,11 @@ METHOD(job_t, terminate_ike_execute, job_requeue_t,
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
} }
else else
{
if (!listener->logger.callback)
{ {
listener->status = SUCCESS; listener->status = SUCCESS;
}
charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager,
ike_sa); ike_sa);
} }
@@ -560,8 +566,11 @@ METHOD(job_t, terminate_child_execute, job_requeue_t,
if (ike_sa->delete_child_sa(ike_sa, child_sa->get_protocol(child_sa), if (ike_sa->delete_child_sa(ike_sa, child_sa->get_protocol(child_sa),
child_sa->get_spi(child_sa, TRUE), FALSE) != DESTROY_ME) child_sa->get_spi(child_sa, TRUE), FALSE) != DESTROY_ME)
{
if (!listener->logger.callback)
{ {
listener->status = SUCCESS; listener->status = SUCCESS;
}
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
} }
else else
@@ -657,4 +666,3 @@ controller_t *controller_create(void)
return &this->public; return &this->public;
} }