Use job priorities in process_message job based on exchange types
This commit is contained in:
@@ -87,7 +87,22 @@ METHOD(job_t, execute, void,
|
|||||||
METHOD(job_t, get_priority, job_priority_t,
|
METHOD(job_t, get_priority, job_priority_t,
|
||||||
private_process_message_job_t *this)
|
private_process_message_job_t *this)
|
||||||
{
|
{
|
||||||
return JOB_PRIO_MEDIUM;
|
switch (this->message->get_exchange_type(this->message))
|
||||||
|
{
|
||||||
|
case IKE_AUTH:
|
||||||
|
/* IKE auth is rather expensive and often blocking, low priority */
|
||||||
|
return JOB_PRIO_LOW;
|
||||||
|
case INFORMATIONAL:
|
||||||
|
/* INFORMATIONALs are inexpensive, for DPD we should have low
|
||||||
|
* reaction times */
|
||||||
|
return JOB_PRIO_HIGH;
|
||||||
|
case IKE_SA_INIT:
|
||||||
|
case CREATE_CHILD_SA:
|
||||||
|
default:
|
||||||
|
/* IKE_SA_INIT is expensive, but we will drop them in the receiver
|
||||||
|
* if we are overloaded */
|
||||||
|
return JOB_PRIO_MEDIUM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user