Use name from initialization to access settings in libcharon.

Also fixes several whitespace errors.
This commit is contained in:
Tobias Brunner
2012-05-03 13:57:04 +02:00
parent 18758e3d2e
commit 42500c274a
56 changed files with 279 additions and 220 deletions
+7 -5
View File
@@ -1982,13 +1982,15 @@ ike_sa_manager_t *ike_sa_manager_create()
return NULL;
}
this->table_size = get_nearest_powerof2(lib->settings->get_int(lib->settings,
"charon.ikesa_table_size", DEFAULT_HASHTABLE_SIZE));
this->table_size = get_nearest_powerof2(lib->settings->get_int(
lib->settings, "%s.ikesa_table_size",
DEFAULT_HASHTABLE_SIZE, charon->name));
this->table_size = max(1, min(this->table_size, MAX_HASHTABLE_SIZE));
this->table_mask = this->table_size - 1;
this->segment_count = get_nearest_powerof2(lib->settings->get_int(lib->settings,
"charon.ikesa_table_segments", DEFAULT_SEGMENT_COUNT));
this->segment_count = get_nearest_powerof2(lib->settings->get_int(
lib->settings, "%s.ikesa_table_segments",
DEFAULT_SEGMENT_COUNT, charon->name));
this->segment_count = max(1, min(this->segment_count, this->table_size));
this->segment_mask = this->segment_count - 1;
@@ -2028,6 +2030,6 @@ ike_sa_manager_t *ike_sa_manager_create()
}
this->reuse_ikesa = lib->settings->get_bool(lib->settings,
"charon.reuse_ikesa", TRUE);
"%s.reuse_ikesa", TRUE, charon->name);
return &this->public;
}