mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-25 20:54:15 +00:00
FS-2936 plan B for curl stuff
This commit is contained in:
1 parent
c196e2c109
commit
acf3090adf
15 files changed
+134
-207
No files matched your search
@@ -36,7 +36,7 @@
|
||||
#include <switch.h>
|
||||
#include <shout/shout.h>
|
||||
#include <lame.h>
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
|
||||
#define OUTSCALE 8192 * 2
|
||||
#define MP3_SCACHE 16384 * 2
|
||||
@@ -1480,7 +1480,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load)
|
||||
supported_formats[0] = "shout";
|
||||
supported_formats[1] = "mp3";
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
switch_curl_init();
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
@@ -1507,7 +1507,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load)
|
||||
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown)
|
||||
{
|
||||
curl_global_cleanup();
|
||||
switch_curl_destroy();
|
||||
mpg123_exit();
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "mod_spidermonkey.h"
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
#endif
|
||||
static int foo = 0;
|
||||
static jsval check_hangup_hook(struct js_session *jss, jsval * rp);
|
||||
@@ -2551,7 +2551,6 @@ 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);
|
||||
@@ -2600,7 +2599,6 @@ 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);
|
||||
@@ -3803,7 +3801,7 @@ 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, "<script> [additional_vars [...]]",
|
||||
SAF_SUPPORT_NOMEDIA);
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
switch_curl_init();
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_NOUNLOAD;
|
||||
@@ -3814,7 +3812,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown)
|
||||
// this causes a crash
|
||||
//JS_DestroyRuntime(globals.rt);
|
||||
|
||||
curl_global_cleanup();
|
||||
switch_curl_destroy();
|
||||
|
||||
switch_core_hash_destroy(&module_manager.mod_hash);
|
||||
switch_core_hash_destroy(&module_manager.load_hash);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
*/
|
||||
#include "mod_spidermonkey.h"
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
|
||||
static const char modname[] = "CURL";
|
||||
|
||||
@@ -242,7 +242,7 @@ const sm_module_interface_t curl_module_interface = {
|
||||
|
||||
SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t ** module_interface)
|
||||
{
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
switch_curl_init();
|
||||
*module_interface = &curl_module_interface;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
*
|
||||
*/
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load);
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown);
|
||||
@@ -548,7 +549,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load)
|
||||
globals.hash_tail = NULL;
|
||||
|
||||
if (do_config() == SWITCH_STATUS_SUCCESS) {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
switch_curl_init();
|
||||
} else {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
@@ -573,7 +574,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown)
|
||||
}
|
||||
|
||||
switch_xml_unbind_search_function_ptr(xml_url_fetch);
|
||||
curl_global_cleanup();
|
||||
switch_curl_destroy();
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user