aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_config_curl.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-25 16:00:54 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-25 16:00:54 +0000
commitdbef4854a5cdf7367b6c3433476dda5bde07ea05 (patch)
tree2d6862cba4365bd014b6a9441d846d125764b701 /res/res_config_curl.c
parent6d937eee360431e9ef782942368d15263d7376ff (diff)
Separate the global initialization routines for cURL into its own separate
module. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@125055 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_curl.c')
-rw-r--r--res/res_config_curl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index 722b08e9d..37079adea 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -538,15 +538,22 @@ static struct ast_config_engine curl_engine = {
.require_func = require_curl,
};
-static int unload_module (void)
+static int unload_module(void)
{
ast_config_engine_deregister(&curl_engine);
ast_verb(1, "res_config_curl unloaded.\n");
return 0;
}
-static int load_module (void)
+static int load_module(void)
{
+ if (!ast_module_check("res_curl.so")) {
+ if (ast_load_resource("res_curl.so") != AST_MODULE_LOAD_SUCCESS) {
+ ast_log(LOG_ERROR, "Cannot load res_curl, so res_config_curl cannot be loaded\n");
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ }
+
ast_config_engine_register(&curl_engine);
ast_verb(1, "res_config_curl loaded.\n");
return 0;