Flush task queues explicitly, not implicitly if task returns ALREADY_DONE
This commit is contained in:
@@ -174,6 +174,8 @@ static status_t send_notify(private_aggressive_mode_t *this, notify_type_t type)
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)informational_create(this->ike_sa, notify));
|
||||
/* cancel all active/passive tasks in favour of informational */
|
||||
this->ike_sa->flush_queue(this->ike_sa,
|
||||
this->initiator ? TASK_QUEUE_ACTIVE : TASK_QUEUE_PASSIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
@@ -185,6 +187,8 @@ static status_t send_delete(private_aggressive_mode_t *this)
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)isakmp_delete_create(this->ike_sa, TRUE));
|
||||
/* cancel all active tasks in favour of informational */
|
||||
this->ike_sa->flush_queue(this->ike_sa,
|
||||
this->initiator ? TASK_QUEUE_ACTIVE : TASK_QUEUE_PASSIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,8 @@ static status_t send_notify(private_main_mode_t *this, notify_type_t type)
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)informational_create(this->ike_sa, notify));
|
||||
/* cancel all active/passive tasks in favour of informational */
|
||||
this->ike_sa->flush_queue(this->ike_sa,
|
||||
this->initiator ? TASK_QUEUE_ACTIVE : TASK_QUEUE_PASSIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
@@ -197,6 +199,8 @@ static status_t send_delete(private_main_mode_t *this)
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)isakmp_delete_create(this->ike_sa, TRUE));
|
||||
/* cancel all active tasks in favour of informational */
|
||||
this->ike_sa->flush_queue(this->ike_sa,
|
||||
this->initiator ? TASK_QUEUE_ACTIVE : TASK_QUEUE_PASSIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ METHOD(task_t, build_i, status_t,
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
this->ike_sa->flush_queue(this->ike_sa, TASK_QUEUE_ACTIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -605,6 +605,8 @@ static status_t send_notify(private_quick_mode_t *this, notify_type_t type)
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)informational_create(this->ike_sa, notify));
|
||||
/* cancel all active/passive tasks in favour of informational */
|
||||
this->ike_sa->flush_queue(this->ike_sa,
|
||||
this->initiator ? TASK_QUEUE_ACTIVE : TASK_QUEUE_PASSIVE);
|
||||
return ALREADY_DONE;
|
||||
}
|
||||
|
||||
@@ -892,6 +894,7 @@ METHOD(task_t, process_r, status_t,
|
||||
}
|
||||
if (!install(this))
|
||||
{
|
||||
this->ike_sa->flush_queue(this->ike_sa, TASK_QUEUE_PASSIVE);
|
||||
this->ike_sa->queue_task(this->ike_sa,
|
||||
(task_t*)quick_delete_create(this->ike_sa,
|
||||
this->proposal->get_protocol(this->proposal),
|
||||
|
||||
Reference in New Issue
Block a user