Revert "IKEv1 XAuth: Added new MIGRATE status type to status_t."
This reverts commit b57df8310a867a0a65abf17279bf1b6e6bb2f5d3. Conflicts: src/libcharon/sa/task_manager_v1.c
This commit is contained in:
@@ -232,25 +232,6 @@ METHOD(task_manager_t, retransmit, status_t,
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void migrate_tasks(linked_list_t *from, linked_list_t *to)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
task_t *task;
|
||||
|
||||
enumerator = from->create_enumerator(from);
|
||||
while(enumerator->enumerate(enumerator, (void**)&task))
|
||||
{
|
||||
DBG4(DBG_IKE, " Migrating %N task to new queue", task_type_names, task->get_type(task));
|
||||
if(task->swap_initiator)
|
||||
{
|
||||
task->swap_initiator(task);
|
||||
}
|
||||
to->insert_last(to, task);
|
||||
from->remove_at(from, enumerator);
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
}
|
||||
|
||||
METHOD(task_manager_t, initiate, status_t,
|
||||
private_task_manager_t *this)
|
||||
{
|
||||
@@ -366,13 +347,6 @@ METHOD(task_manager_t, initiate, status_t,
|
||||
this->active_tasks->remove_at(this->active_tasks, enumerator);
|
||||
task->destroy(task);
|
||||
break;
|
||||
case MIGRATE:
|
||||
/* task completed, remove it */
|
||||
this->active_tasks->remove_at(this->active_tasks, enumerator);
|
||||
task->destroy(task);
|
||||
/* migrate the remaining active tasks to the passive queue */
|
||||
migrate_tasks(this->active_tasks, this->passive_tasks);
|
||||
break;
|
||||
case NEED_MORE:
|
||||
/* processed, but task needs another exchange */
|
||||
break;
|
||||
@@ -434,7 +408,6 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
|
||||
host_t *me, *other;
|
||||
bool delete = FALSE;
|
||||
status_t status;
|
||||
bool migrate = FALSE;
|
||||
|
||||
me = request->get_destination(request);
|
||||
other = request->get_source(request);
|
||||
@@ -452,9 +425,6 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
|
||||
{
|
||||
switch (task->build(task, message))
|
||||
{
|
||||
case MIGRATE:
|
||||
migrate = TRUE;
|
||||
/* FALL */
|
||||
case SUCCESS:
|
||||
/* task completed, remove it */
|
||||
this->passive_tasks->remove_at(this->passive_tasks, enumerator);
|
||||
@@ -501,14 +471,6 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
|
||||
|
||||
charon->sender->send(charon->sender,
|
||||
this->responding.packet->clone(this->responding.packet));
|
||||
|
||||
if (migrate)
|
||||
{
|
||||
migrate_tasks(this->passive_tasks, this->queued_tasks);
|
||||
/* Kick off the newly installed tasks */
|
||||
initiate(this);
|
||||
}
|
||||
|
||||
if (delete)
|
||||
{
|
||||
return DESTROY_ME;
|
||||
@@ -564,16 +526,6 @@ static status_t process_request(private_task_manager_t *this,
|
||||
task->destroy(task);
|
||||
enumerator->destroy(enumerator);
|
||||
return SUCCESS;
|
||||
case MIGRATE:
|
||||
/* task completed, remove it */
|
||||
this->passive_tasks->remove_at(this->passive_tasks, enumerator);
|
||||
task->destroy(task);
|
||||
enumerator->destroy(enumerator);
|
||||
/* migrate the remaining tasks */
|
||||
migrate_tasks(this->passive_tasks, this->queued_tasks);
|
||||
/* Kick off the newly installed tasks */
|
||||
initiate(this);
|
||||
return SUCCESS;
|
||||
case NEED_MORE:
|
||||
/* processed, but task needs at least another call to build() */
|
||||
break;
|
||||
|
||||
@@ -299,12 +299,6 @@ enum status_t {
|
||||
* Another call to the method is required.
|
||||
*/
|
||||
NEED_MORE,
|
||||
|
||||
/**
|
||||
* For tasks only, same as SUCCESS, but also migrate all remaining tasks
|
||||
* in the current queue to the opposite queue (passive->active or active->passive)
|
||||
*/
|
||||
MIGRATE,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user