host_t *me, *other;
status_t status;
exchange_type_t exchange = EXCHANGE_TYPE_UNDEFINED;
- bool new_mid = FALSE;
- bool expect_response = FALSE;
+ bool new_mid = FALSE, expect_response = FALSE, flushed = FALSE;
if (!this->rng)
{
continue;
case ALREADY_DONE:
flush_queue(this, this->active_tasks);
+ flushed = TRUE;
break;
case FAILED:
default:
{ /* tasks completed, no exchange active anymore */
this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
}
+ if (flushed)
+ {
+ message->destroy(message);
+ return initiate(this);
+ }
this->initiating.seqnr++;
status = this->ike_sa->generate_message(this->ike_sa, message,
task_t *task;
message_t *message;
host_t *me, *other;
- bool delete = FALSE;
+ bool delete = FALSE, flushed = FALSE;
status_t status;
me = request->get_destination(request);
continue;
case ALREADY_DONE:
flush_queue(this, this->passive_tasks);
+ flushed = TRUE;
break;
case FAILED:
default:
}
enumerator->destroy(enumerator);
- /* message complete, send it */
DESTROY_IF(this->responding.packet);
this->responding.packet = NULL;
+ if (flushed)
+ {
+ message->destroy(message);
+ return initiate(this);
+ }
status = this->ike_sa->generate_message(this->ike_sa, message,
&this->responding.packet);
message->destroy(message);