From c196e2c109102fa397fe1f73fa1436eb170e8193 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 13 May 2011 12:03:30 -0500 Subject: [PATCH] revert curl changes --- src/mod/applications/mod_cidlookup/Makefile | 1 + src/mod/applications/mod_curl/Makefile | 1 + src/mod/applications/mod_memcache/Makefile | 2 ++ src/mod/event_handlers/mod_json_cdr/Makefile | 1 + src/mod/formats/mod_shout/Makefile | 2 ++ src/mod/formats/mod_shout/mod_shout.c | 3 +++ src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 6 ++++++ src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c | 1 + src/mod/xml_int/mod_xml_cdr/Makefile | 1 + src/mod/xml_int/mod_xml_curl/Makefile | 1 + src/mod/xml_int/mod_xml_curl/mod_xml_curl.c | 5 ++++- src/switch_core.c | 3 --- 12 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_cidlookup/Makefile b/src/mod/applications/mod_cidlookup/Makefile index 24790d0d39..5ffe1d8476 100644 --- a/src/mod/applications/mod_cidlookup/Makefile +++ b/src/mod/applications/mod_cidlookup/Makefile @@ -1,3 +1,4 @@ +WANT_CURL=yes BASE=../../../.. include $(BASE)/build/modmake.rules diff --git a/src/mod/applications/mod_curl/Makefile b/src/mod/applications/mod_curl/Makefile index 6cae5a8595..b276633355 100644 --- a/src/mod/applications/mod_curl/Makefile +++ b/src/mod/applications/mod_curl/Makefile @@ -1,5 +1,6 @@ json-c=json-c-0.9 BASE=../../../.. +WANT_CURL=yes JSON_DIR=$(switch_srcdir)/libs/$(json-c) JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c) diff --git a/src/mod/applications/mod_memcache/Makefile b/src/mod/applications/mod_memcache/Makefile index 0f469ff9e2..80c1d2b936 100644 --- a/src/mod/applications/mod_memcache/Makefile +++ b/src/mod/applications/mod_memcache/Makefile @@ -1,6 +1,8 @@ MEMCACHED=libmemcached-0.32 BASE=../../../.. +WANT_CURL=yes + MEMCACHED_DIR=$(switch_srcdir)/libs/$(MEMCACHED) MEMCACHED_BUILDDIR=$(switch_builddir)/libs/$(MEMCACHED) diff --git a/src/mod/event_handlers/mod_json_cdr/Makefile b/src/mod/event_handlers/mod_json_cdr/Makefile index 1819f0a4c3..d5043e017d 100644 --- a/src/mod/event_handlers/mod_json_cdr/Makefile +++ b/src/mod/event_handlers/mod_json_cdr/Makefile @@ -1,5 +1,6 @@ json-c=json-c-0.9 BASE=../../../.. +WANT_CURL=yes JSON_DIR=$(switch_srcdir)/libs/$(json-c) JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c) diff --git a/src/mod/formats/mod_shout/Makefile b/src/mod/formats/mod_shout/Makefile index 50dc9d5b3a..7388bc0c67 100644 --- a/src/mod/formats/mod_shout/Makefile +++ b/src/mod/formats/mod_shout/Makefile @@ -3,6 +3,8 @@ SHOUT=libshout-2.2.2 MPG123=mpg123-1.13.2 BASE=../../../.. +WANT_CURL=yes + LAME_DIR=$(switch_srcdir)/libs/$(LAME) SHOUT_DIR=$(switch_srcdir)/libs/$(SHOUT) MPG123_DIR=$(switch_srcdir)/libs/$(MPG123) diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c index c506e18933..377cfe520c 100644 --- a/src/mod/formats/mod_shout/mod_shout.c +++ b/src/mod/formats/mod_shout/mod_shout.c @@ -1480,6 +1480,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load) supported_formats[0] = "shout"; supported_formats[1] = "mp3"; + curl_global_init(CURL_GLOBAL_ALL); + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE); @@ -1505,6 +1507,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown) { + curl_global_cleanup(); mpg123_exit(); return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 30ec8789d6..7341a2b1e1 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2551,6 +2551,7 @@ static JSBool js_fetchurl_file(JSContext * cx, JSObject * obj, uintN argc, jsval url = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); filename = JS_GetStringBytes(JS_ValueToString(cx, argv[1])); + curl_global_init(CURL_GLOBAL_ALL); curl_handle = curl_easy_init(); if (!strncasecmp(url, "https", 5)) { curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); @@ -2599,6 +2600,7 @@ static JSBool js_fetchurl(JSContext * cx, JSObject * obj, uintN argc, jsval * ar JS_ValueToInt32(cx, argv[1], &buffer_size); } + curl_global_init(CURL_GLOBAL_ALL); curl_handle = curl_easy_init(); if (!strncasecmp(url, "https", 5)) { curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); @@ -3801,6 +3803,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load) SWITCH_ADD_APP(app_interface, "javascript", "Launch JS ivr", "Run a javascript ivr on a channel", js_dp_function, "