Use CRITICAL job priority class for long running dispatcher jobs
[strongswan.git] / src / libcharon / network / sender.c
index 5413842..4df930b 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "sender.h"
 
-#include <hydra.h>
 #include <daemon.h>
 #include <network/socket.h>
 #include <processing/jobs/callback_job.h>
@@ -184,8 +183,8 @@ sender_t * sender_create()
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .got = condvar_create(CONDVAR_TYPE_DEFAULT),
                .sent = condvar_create(CONDVAR_TYPE_DEFAULT),
-               .job = callback_job_create((callback_job_cb_t)send_packets,
-                                                                       this, NULL, NULL),
+               .job = callback_job_create_with_prio((callback_job_cb_t)send_packets,
+                                                                               this, NULL, NULL, JOB_PRIO_CRITICAL),
                .send_delay = lib->settings->get_int(lib->settings,
                                                                                        "charon.send_delay", 0),
                .send_delay_type = lib->settings->get_int(lib->settings,
@@ -196,7 +195,7 @@ sender_t * sender_create()
                                                                                        "charon.send_delay_response", TRUE),
        );
 
-       hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
+       lib->processor->queue_job(lib->processor, (job_t*)this->job);
 
        return &this->public;
 }