Skip to content

Commit

Permalink
lcr: added module prefix to db_url global variable
Browse files Browse the repository at this point in the history
- safety for symbols overlapping
  • Loading branch information
miconda committed Jan 3, 2024
1 parent f0fbf4d commit 42b22b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/lcr/lcr_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ gen_lock_t *reload_lock;

/* database variables */
/* clang-format off */
static str db_url = str_init(DEFAULT_RODB_URL);
static str lcr_db_url = str_init(DEFAULT_RODB_URL);
static str lcr_rule_table = str_init(LCR_RULE_TABLE);
static str lcr_rule_target_table = str_init(LCR_RULE_TARGET_TABLE);
static str lcr_gw_table = str_init(LCR_GW_TABLE);
Expand Down Expand Up @@ -313,7 +313,7 @@ static cmd_export_t cmds[] = {
* Exported parameters
*/
static param_export_t params[] = {
{"db_url", PARAM_STR, &db_url},
{"db_url", PARAM_STR, &lcr_db_url},
{"lcr_rule_table", PARAM_STR, &lcr_rule_table},
{"lcr_rule_target_table", PARAM_STR, &lcr_rule_target_table},
{"lcr_gw_table", PARAM_STR, &lcr_gw_table},
Expand Down Expand Up @@ -455,7 +455,7 @@ static int mod_init(void)
}

/* Bind database */
if(lcr_db_bind(&db_url)) {
if(lcr_db_bind(&lcr_db_url)) {
LM_ERR("no database module found\n");
return -1;
}
Expand Down Expand Up @@ -692,7 +692,7 @@ static int mod_init(void)
}

/* Check table version */
if(lcr_db_init(&db_url) < 0) {
if(lcr_db_init(&lcr_db_url) < 0) {
LM_ERR("unable to open database connection\n");
return -1;
}
Expand Down Expand Up @@ -1484,7 +1484,7 @@ int reload_tables()

request_uri_re = from_uri_re = 0;

if(lcr_db_init(&db_url) < 0) {
if(lcr_db_init(&lcr_db_url) < 0) {
LM_ERR("unable to open database connection\n");
return -1;
}
Expand Down

0 comments on commit 42b22b6

Please sign in to comment.