Let Stasis load itself with default values

While a Stasis configuration file is nice, it shouldn't be mandatory.
We can carry on with default values.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2013-07-03 21:14:03 +00:00
parent 0f725bd5d9
commit 569f5f2117

View File

@@ -150,13 +150,20 @@ void stasis_config_get_threadpool_options(
/*! \brief Load (or reload) configuration. */ /*! \brief Load (or reload) configuration. */
static int process_config(int reload) static int process_config(int reload)
{ {
switch (aco_process_config(&cfg_info, reload)) { RAII_VAR(struct stasis_conf *, conf, conf_alloc(), ao2_cleanup);
case ACO_PROCESS_ERROR:
return -1; switch (aco_process_config(&cfg_info, reload)) {
case ACO_PROCESS_OK: case ACO_PROCESS_ERROR:
case ACO_PROCESS_UNCHANGED: if (conf && !reload && !aco_set_defaults(&threadpool_option, "threadpool", conf->threadpool)) {
break; ast_log(AST_LOG_NOTICE, "Failed to process Stasis configuration; using defaults\n");
} ao2_global_obj_replace(confs, conf);
return 0;
}
return -1;
case ACO_PROCESS_OK:
case ACO_PROCESS_UNCHANGED:
break;
}
return 0; return 0;
} }