Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5e0fc8f6
提交
5e0fc8f6
authored
3月 12, 2014
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove usage of apr dso functions, we have our own dso abstraction
上级
75c5c980
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
79 行删除
+15
-79
switch_apr.h
src/include/switch_apr.h
+0
-49
modjava.c
src/mod/languages/mod_java/modjava.c
+15
-7
switch_apr.c
src/switch_apr.c
+0
-23
没有找到文件。
src/include/switch_apr.h
浏览文件 @
5e0fc8f6
...
...
@@ -88,55 +88,6 @@ SWITCH_DECLARE(void) switch_pool_clear(switch_memory_pool_t *p);
/** @} */
/**
* @defgroup switch_dso Dynamic Object Handling Routines
* @ingroup switch_apr
* @{
*/
/**
* Structure for referencing dynamic objects
*/
typedef
struct
apr_dso_handle_t
switch_dso_handle_t
;
/**
* Structure for referencing symbols from dynamic objects
*/
typedef
void
*
switch_dso_handle_sym_t
;
/**
* Load a DSO library.
* @param res_handle Location to store new handle for the DSO.
* @param path Path to the DSO library
* @param ctx Pool to use.
* @bug We aught to provide an alternative to RTLD_GLOBAL, which
* is the only supported method of loading DSOs today.
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_load
(
switch_dso_handle_t
**
res_handle
,
const
char
*
path
,
switch_memory_pool_t
*
ctx
);
/**
* Close a DSO library.
* @param handle handle to close.
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_unload
(
switch_dso_handle_t
*
handle
);
/**
* Load a symbol from a DSO handle.
* @param ressym Location to store the loaded symbol
* @param handle handle to load the symbol from.
* @param symname Name of the symbol to load.
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_sym
(
switch_dso_handle_sym_t
*
ressym
,
switch_dso_handle_t
*
handle
,
const
char
*
symname
);
/**
* Report more information when a DSO function fails.
* @param dso The dso handle that has been opened
* @param buf Location to store the dso error
* @param bufsize The size of the provided buffer
*/
SWITCH_DECLARE
(
const
char
*
)
switch_dso_error
(
switch_dso_handle_t
*
dso
,
char
*
buf
,
size_t
bufsize
);
/** @} */
/**
* @defgroup switch_string String Handling funcions
* @ingroup switch_apr
...
...
src/mod/languages/mod_java/modjava.c
浏览文件 @
5e0fc8f6
...
...
@@ -35,7 +35,7 @@
static
switch_memory_pool_t
*
memoryPool
=
NULL
;
static
switch_dso_
handle_t
*
javaVMHandle
=
NULL
;
static
switch_dso_
lib_t
javaVMHandle
=
NULL
;
JavaVM
*
javaVM
=
NULL
;
jclass
launcherClass
=
NULL
;
...
...
@@ -188,6 +188,7 @@ static switch_status_t load_config(JavaVMOption **javaOptions, int *optionCount,
{
switch_xml_t
cfg
,
xml
;
switch_status_t
status
;
char
*
derr
=
NULL
;
xml
=
switch_xml_open_cfg
(
"java.conf"
,
&
cfg
,
NULL
);
if
(
xml
)
...
...
@@ -203,9 +204,10 @@ static switch_status_t load_config(JavaVMOption **javaOptions, int *optionCount,
const
char
*
path
=
switch_xml_attr_soft
(
javavm
,
"path"
);
if
(
path
!=
NULL
)
{
status
=
switch_dso_load
(
&
javaVMHandle
,
path
,
memoryPool
);
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
javaVMHandle
=
switch_dso_open
(
path
,
0
,
&
derr
);
if
(
derr
||
!
dso
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error loading %s
\n
"
,
path
);
}
}
else
{
...
...
@@ -291,9 +293,11 @@ static switch_status_t create_java_vm(JavaVMOption *options, int optionCount, vm
{
jint
(
JNICALL
*
pJNI_CreateJavaVM
)(
JavaVM
**
,
void
**
,
void
*
);
switch_status_t
status
;
char
*
derr
=
NULL
;
status
=
switch_dso_sym
((
void
*
)
&
pJNI_CreateJavaVM
,
javaVMHandle
,
"JNI_CreateJavaVM"
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
pJNI_CreateJavaVM
=
(
void
*
)
switch_dso_func_sym
(
javaVMHandle
,
"JNI_CreateJavaVM"
,
&
derr
)
if
(
!
derr
)
{
JNIEnv
*
env
;
JavaVMInitArgs
initArgs
;
...
...
@@ -380,7 +384,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_java_load)
}
}
switch_dso_unload
(
javaVMHandle
);
if
(
javaVMHandle
)
{
switch_dso_destroy
(
&
javaVMHandle
);
}
}
switch_core_destroy_memory_pool
(
&
memoryPool
);
}
...
...
@@ -398,7 +404,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_java_shutdown)
exec_user_method
(
&
vmControl
.
shutdown
);
(
*
javaVM
)
->
DestroyJavaVM
(
javaVM
);
javaVM
=
NULL
;
switch_dso_unload
(
javaVMHandle
);
if
(
javaVMHandle
)
{
switch_dso_destroy
(
&
javaVMHandle
);
}
switch_core_destroy_memory_pool
(
&
memoryPool
);
return
SWITCH_STATUS_SUCCESS
;
}
...
...
src/switch_apr.c
浏览文件 @
5e0fc8f6
...
...
@@ -51,7 +51,6 @@
#include <apr_thread_rwlock.h>
#include <apr_file_io.h>
#include <apr_poll.h>
#include <apr_dso.h>
#include <apr_strings.h>
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
...
...
@@ -123,28 +122,6 @@ SWITCH_DECLARE(unsigned int) switch_hashfunc_default(const char *key, switch_ssi
return
apr_hashfunc_default
(
key
,
klen
);
}
/* DSO functions */
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_load
(
switch_dso_handle_t
**
res_handle
,
const
char
*
path
,
switch_memory_pool_t
*
ctx
)
{
return
apr_dso_load
(
res_handle
,
path
,
ctx
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_unload
(
switch_dso_handle_t
*
handle
)
{
return
apr_dso_unload
(
handle
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_dso_sym
(
switch_dso_handle_sym_t
*
ressym
,
switch_dso_handle_t
*
handle
,
const
char
*
symname
)
{
return
apr_dso_sym
(
ressym
,
handle
,
symname
);
}
SWITCH_DECLARE
(
const
char
*
)
switch_dso_error
(
switch_dso_handle_t
*
dso
,
char
*
buf
,
size_t
bufsize
)
{
return
apr_dso_error
(
dso
,
buf
,
bufsize
);
}
/* string functions */
SWITCH_DECLARE
(
switch_status_t
)
switch_strftime
(
char
*
s
,
switch_size_t
*
retsize
,
switch_size_t
max
,
const
char
*
format
,
switch_time_exp_t
*
tm
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论