Skip to content

Commit

Permalink
module dependencies core: properly handle the USE_FUNC_PARAM
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Aug 13, 2014
1 parent 5b470b8 commit 8d4b329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 1 addition & 11 deletions modules/avpops/avpops.c
Expand Up @@ -180,22 +180,12 @@ static param_export_t params[] = {
{0, 0, 0}
};

static module_dependency_t *get_deps_db_url(param_export_t *param)
{
char *db_url = *(char **)param->param_pointer;

if (!db_url || strlen(db_url) == 0)
return NULL;

return alloc_module_dep(MOD_TYPE_SQLDB, NULL);
}

static dep_export_t deps = {
{ /* OpenSIPS module dependencies */
{ MOD_TYPE_NULL, NULL },
},
{ /* modparam dependencies */
{ "db_url", get_deps_db_url },
{ "db_url", get_deps_sqldb_url },
{ NULL, NULL },
},
};
Expand Down
3 changes: 3 additions & 0 deletions sr_module_deps.c
Expand Up @@ -65,6 +65,9 @@ module_dependency_t *get_deps_sqldb_url(param_export_t *param)
{
char *db_url = *(char **)param->param_pointer;

if (param->type & USE_FUNC_PARAM)
return alloc_module_dep(MOD_TYPE_SQLDB, NULL);

if (!db_url || strlen(db_url) == 0)
return NULL;

Expand Down

0 comments on commit 8d4b329

Please sign in to comment.