/* main_config.c */
/* Define a global config structure */
-extern bool log_dates_utc;
-extern bool check_config;
-extern struct main_config_t main_config;
+extern bool log_dates_utc;
+extern bool check_config;
+extern struct main_config_t main_config;
+extern bool event_loop_started;
void set_radius_dir(TALLOC_CTX *ctx, char const *path);
char const *get_radius_dir(void);
# include <fcntl.h>
#endif
-struct main_config_t main_config;
-extern fr_cond_t *debug_condition;
-fr_cond_t *debug_condition;
+struct main_config_t main_config; //!< Main server configuration.
+extern fr_cond_t *debug_condition;
+fr_cond_t *debug_condition; //!< Condition used to mark packets up for checking.
+bool event_loop_started = false; //!< Whether the main event loop has been started yet.
typedef struct cached_config_t {
struct cached_config_t *next;
static realm_config_t *realm_config = NULL;
-static bool realms_initialized = false;
#ifdef WITH_PROXY
static rbtree_t *home_servers_byaddr = NULL;
CONF_SECTION *tls;
- /*
- * The structs aren't mutex protected. Refuse to destroy
- * the server.
- */
- if (realms_initialized && !realm_config->dynamic) {
- ERROR("Failed to add dynamic home server, \"dynamic = true\" must be set in proxy.conf");
- return false;
- }
if (!rc) rc = realm_config; /* Use the global config */
home = talloc_zero(ctx, home_server_t);
#ifndef HAVE_PTHREAD_H
void realm_pool_free(home_pool_t *pool)
{
- if (!realms_initialized) return;
+ if (!event_loop_started) return;
if (!realm_config->dynamic) return;
talloc_free(pool);
time_t now;
pool_list_t *this, **last;
- if (!realms_initialized) return;
+ if (!event_loop_started) return;
if (!realm_config->dynamic) return;
if (pool) {
* The structs aren't mutex protected. Refuse to destroy
* the server.
*/
- if (realms_initialized && !realm_config->dynamic) {
+ if (event_loop_started && !realm_config->dynamic) {
DEBUG("Must set \"dynamic = true\" in proxy.conf");
return 0;
}
* The structs aren't mutex protected. Refuse to destroy
* the server.
*/
- if (realms_initialized && !realm_config->dynamic) {
+ if (event_loop_started && !realm_config->dynamic) {
DEBUG("Must set \"dynamic = true\" in proxy.conf");
return 0;
}
#endif
realm_config_t *rc;
- if (realms_initialized) return 1;
+ if (event_loop_started) return 1;
rc = talloc_zero(NULL, realm_config_t);
rc->cs = config;
#endif
realm_config = rc;
- realms_initialized = true;
return 1;
}