host_t *me, *other;
status_t status;
exchange_type_t exchange = EXCHANGE_TYPE_UNDEFINED;
- bool new_mid = FALSE, expect_response = FALSE, flushed = FALSE, keep = FALSE;
+ bool new_mid = FALSE, expect_response = FALSE, cancelled = FALSE, keep = FALSE;
if (this->initiating.type != EXCHANGE_TYPE_UNDEFINED &&
this->initiating.type != INFORMATIONAL_V1)
/* processed, but task needs another exchange */
continue;
case ALREADY_DONE:
- flush_queue(this, TASK_QUEUE_ACTIVE);
- flushed = TRUE;
+ cancelled = TRUE;
break;
case FAILED:
default:
{ /* tasks completed, no exchange active anymore */
this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
}
- if (flushed)
+ if (cancelled)
{
message->destroy(message);
return initiate(this);
task_t *task;
message_t *message;
host_t *me, *other;
- bool delete = FALSE, flushed = FALSE, expect_request = FALSE;
+ bool delete = FALSE, cancelled = FALSE, expect_request = FALSE;
status_t status;
me = request->get_destination(request);
}
continue;
case ALREADY_DONE:
- flush_queue(this, TASK_QUEUE_PASSIVE);
- flushed = TRUE;
+ cancelled = TRUE;
break;
case FAILED:
default:
DESTROY_IF(this->responding.packet);
this->responding.packet = NULL;
- if (flushed)
+ if (cancelled)
{
message->destroy(message);
return initiate(this);
continue;
case ALREADY_DONE:
send_response = FALSE;
- flush_queue(this, TASK_QUEUE_PASSIVE);
break;
case FAILED:
default:
/* processed, but task needs another exchange */
continue;
case ALREADY_DONE:
- flush_queue(this, TASK_QUEUE_ACTIVE);
break;
case FAILED:
default:
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;
}
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;
}
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;
}
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;
}
return SUCCESS;
}
+ this->ike_sa->flush_queue(this->ike_sa, TASK_QUEUE_ACTIVE);
return ALREADY_DONE;
}
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;
}
}
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),
* - FAILED if a critical error occurred
* - DESTROY_ME if IKE_SA has been properly deleted
* - NEED_MORE if another call to build/process needed
- * - ALREADY_DONE to cancel all active or passive tasks
+ * - ALREADY_DONE to cancel task processing
* - SUCCESS if task completed
*/
status_t (*build) (task_t *this, message_t *message);
* - FAILED if a critical error occurred
* - DESTROY_ME if IKE_SA has been properly deleted
* - NEED_MORE if another call to build/process needed
- * - ALREADY_DONE to cancel all active or passive tasks
+ * - ALREADY_DONE to cancel task processing
* - SUCCESS if task completed
*/
status_t (*process) (task_t *this, message_t *message);