summaryrefslogtreecommitdiff
path: root/res/res_config_sqlite.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-03-11 22:55:16 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-03-11 22:55:16 +0000
commitd02f74ebfe5354833d304c47c77849dcfd604cfe (patch)
tree044b5e038aebbcadb348b2b79dc47b6fea73339e /res/res_config_sqlite.c
parentc89a4be6e7764e69458181da254454832221e92d (diff)
An offhand comment from Russell made me realize that the configuration file
caching would not work properly for users.conf and any other file read from more than one place. I needed to add the filename which requested the config file to get it to work properly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_sqlite.c')
-rw-r--r--res/res_config_sqlite.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index fb22009b2..7eea32af8 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -178,6 +178,7 @@ struct cfg_entry_args {
struct ast_category *cat;
char *cat_name;
struct ast_flags flags;
+ const char *who_asked;
};
/*!
@@ -277,7 +278,7 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames);
* \see add_cfg_entry()
*/
static struct ast_config * config_handler(const char *database, const char *table, const char *file,
- struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl);
+ struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl, const char *who_asked);
/*!
* \brief Helper function to parse a va_list object into 2 dynamic arrays of
@@ -710,7 +711,7 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames)
char *val;
val = argv[RES_CONFIG_SQLITE_CONFIG_VAR_VAL];
- cfg = ast_config_internal_load(val, args->cfg, args->flags, "");
+ cfg = ast_config_internal_load(val, args->cfg, args->flags, "", args->who_asked);
if (!cfg) {
ast_log(LOG_WARNING, "Unable to include %s\n", val);
@@ -753,7 +754,7 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames)
}
static struct ast_config *config_handler(const char *database, const char *table, const char *file,
- struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl)
+ struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl, const char *who_asked)
{
struct cfg_entry_args args;
char *query, *errormsg;
@@ -779,6 +780,7 @@ static struct ast_config *config_handler(const char *database, const char *table
args.cat = NULL;
args.cat_name = NULL;
args.flags = flags;
+ args.who_asked = who_asked;
ast_mutex_lock(&mutex);