instanciate new tasks only if none queued

This commit is contained in:
Martin Willi
2009-05-07 15:57:34 +02:00
parent a627e31f46
commit 0ce19b27a6
+7 -6
View File
@@ -655,7 +655,8 @@ static status_t process_request(private_task_manager_t *this,
notify_payload_t *notify; notify_payload_t *notify;
delete_payload_t *delete; delete_payload_t *delete;
/* create tasks depending on request type */ if (this->passive_tasks->get_count(this->passive_tasks) == 0)
{ /* create tasks depending on request type, if not already some queued */
switch (message->get_exchange_type(message)) switch (message->get_exchange_type(message))
{ {
case IKE_SA_INIT: case IKE_SA_INIT:
@@ -693,8 +694,7 @@ static status_t process_request(private_task_manager_t *this,
switch (payload->get_type(payload)) switch (payload->get_type(payload))
{ {
case NOTIFY: case NOTIFY:
{ { /* if we find a rekey notify, its CHILD_SA rekeying */
/* if we find a rekey notify, its CHILD_SA rekeying */
notify = (notify_payload_t*)payload; notify = (notify_payload_t*)payload;
if (notify->get_notify_type(notify) == REKEY_SA && if (notify->get_notify_type(notify) == REKEY_SA &&
(notify->get_protocol_id(notify) == PROTO_AH || (notify->get_protocol_id(notify) == PROTO_AH ||
@@ -706,8 +706,7 @@ static status_t process_request(private_task_manager_t *this,
} }
case TRAFFIC_SELECTOR_INITIATOR: case TRAFFIC_SELECTOR_INITIATOR:
case TRAFFIC_SELECTOR_RESPONDER: case TRAFFIC_SELECTOR_RESPONDER:
{ { /* if we don't find a TS, its IKE rekeying */
/* if we don't find a TS, its IKE rekeying */
ts_found = TRUE; ts_found = TRUE;
break; break;
} }
@@ -775,7 +774,8 @@ static status_t process_request(private_task_manager_t *this,
delete = (delete_payload_t*)payload; delete = (delete_payload_t*)payload;
if (delete->get_protocol_id(delete) == PROTO_IKE) if (delete->get_protocol_id(delete) == PROTO_IKE)
{ {
task = (task_t*)ike_delete_create(this->ike_sa, FALSE); task = (task_t*)ike_delete_create(this->ike_sa,
FALSE);
} }
else else
{ {
@@ -811,6 +811,7 @@ static status_t process_request(private_task_manager_t *this,
default: default:
break; break;
} }
}
/* let the tasks process the message */ /* let the tasks process the message */
iterator = this->passive_tasks->create_iterator(this->passive_tasks, TRUE); iterator = this->passive_tasks->create_iterator(this->passive_tasks, TRUE);