fixed a at-least-one-year-old bug which caused crashed in the scheduler
This commit is contained in:
@@ -67,3 +67,5 @@
|
|||||||
when a blocked IKE_SA receives a lot of messages
|
when a blocked IKE_SA receives a lot of messages
|
||||||
- add a crl fetch mechanism which synchronizes equal fetches
|
- add a crl fetch mechanism which synchronizes equal fetches
|
||||||
- add support for CERTREQs
|
- add support for CERTREQs
|
||||||
|
- use same reqid for routed connections when they are set up
|
||||||
|
- add firewall script support
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ static chunk_t generate_natd_hash(private_ike_sa_init_t *this,
|
|||||||
spi_i_chunk.len = sizeof(spi_i);
|
spi_i_chunk.len = sizeof(spi_i);
|
||||||
spi_r_chunk.ptr = (void*)&spi_r;
|
spi_r_chunk.ptr = (void*)&spi_r;
|
||||||
spi_r_chunk.len = sizeof(spi_r);
|
spi_r_chunk.len = sizeof(spi_r);
|
||||||
port = host->get_port(host);
|
port = htons(host->get_port(host));
|
||||||
port_chunk.ptr = (void*)&port;
|
port_chunk.ptr = (void*)&port;
|
||||||
port_chunk.len = sizeof(port);
|
port_chunk.len = sizeof(port);
|
||||||
addr_chunk = host->get_address(host);
|
addr_chunk = host->get_address(host);
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ static void get_events(private_scheduler_t * this)
|
|||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
this->logger->log(this->logger, CONTROL|LEVEL2, "Waiting for next event...");
|
this->logger->log(this->logger, CONTROL|LEVEL2, "waiting for next event...");
|
||||||
/* get a job, this block until one is available */
|
/* get a job, this block until one is available */
|
||||||
current_job = charon->event_queue->get(charon->event_queue);
|
current_job = charon->event_queue->get(charon->event_queue);
|
||||||
/* queue the job in the job queue, workers will eat them */
|
/* queue the job in the job queue, workers will eat them */
|
||||||
charon->job_queue->add(charon->job_queue, current_job);
|
this->logger->log(this->logger, CONTROL | LEVEL1, "got event, adding job %s to job-queue.",
|
||||||
this->logger->log(this->logger, CONTROL | LEVEL1, "Got event, added job %s to job-queue.",
|
|
||||||
mapping_find(job_type_m, current_job->get_type(current_job)));
|
mapping_find(job_type_m, current_job->get_type(current_job)));
|
||||||
|
charon->job_queue->add(charon->job_queue, current_job);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,11 +83,11 @@ static void get_events(private_scheduler_t * this)
|
|||||||
*/
|
*/
|
||||||
static void destroy(private_scheduler_t *this)
|
static void destroy(private_scheduler_t *this)
|
||||||
{
|
{
|
||||||
this->logger->log(this->logger, CONTROL | LEVEL1, "Going to terminate scheduler thread");
|
this->logger->log(this->logger, CONTROL | LEVEL1, "going to terminate scheduler thread");
|
||||||
pthread_cancel(this->assigned_thread);
|
pthread_cancel(this->assigned_thread);
|
||||||
|
|
||||||
pthread_join(this->assigned_thread, NULL);
|
pthread_join(this->assigned_thread, NULL);
|
||||||
this->logger->log(this->logger, CONTROL | LEVEL1, "Scheduler thread terminated");
|
this->logger->log(this->logger, CONTROL | LEVEL1, "scheduler thread terminated");
|
||||||
|
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
@@ -106,9 +106,9 @@ scheduler_t * scheduler_create()
|
|||||||
if (pthread_create(&(this->assigned_thread), NULL, (void*(*)(void*))get_events, this) != 0)
|
if (pthread_create(&(this->assigned_thread), NULL, (void*(*)(void*))get_events, this) != 0)
|
||||||
{
|
{
|
||||||
/* thread could not be created */
|
/* thread could not be created */
|
||||||
this->logger->log(this->logger, ERROR, "Scheduler thread could not be created!");
|
this->logger->log(this->logger, ERROR, "scheduler thread could not be created!");
|
||||||
free(this);
|
free(this);
|
||||||
charon->kill(charon, "Unable to create scheduler thread");
|
charon->kill(charon, "unable to create scheduler thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
return &(this->public);
|
return &(this->public);
|
||||||
|
|||||||
Reference in New Issue
Block a user