Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7e9f64ee
提交
7e9f64ee
authored
7月 30, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@9210
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
f3cea0b7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
0 行删除
+39
-0
switch_xml.h
src/include/switch_xml.h
+1
-0
switch_xml.c
src/switch_xml.c
+38
-0
没有找到文件。
src/include/switch_xml.h
浏览文件 @
7e9f64ee
...
@@ -215,6 +215,7 @@ SWITCH_DECLARE(const char **) switch_xml_pi(switch_xml_t xml, const char *target
...
@@ -215,6 +215,7 @@ SWITCH_DECLARE(const char **) switch_xml_pi(switch_xml_t xml, const char *target
///\param xml the xml node
///\param xml the xml node
///\note in the case of the root node the readlock will be lifted
///\note in the case of the root node the readlock will be lifted
SWITCH_DECLARE
(
void
)
switch_xml_free
(
switch_xml_t
xml
);
SWITCH_DECLARE
(
void
)
switch_xml_free
(
switch_xml_t
xml
);
SWITCH_DECLARE
(
void
)
switch_xml_free_in_thread
(
switch_xml_t
xml
,
int
stacksize
);
///\brief returns parser error message or empty string if none
///\brief returns parser error message or empty string if none
///\param xml the xml node
///\param xml the xml node
...
...
src/switch_xml.c
浏览文件 @
7e9f64ee
...
@@ -1523,6 +1523,43 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_root(void)
...
@@ -1523,6 +1523,43 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_root(void)
return
MAIN_XML_ROOT
;
return
MAIN_XML_ROOT
;
}
}
struct
destroy_xml
{
switch_xml_t
xml
;
switch_memory_pool_t
*
pool
;
};
static
void
*
SWITCH_THREAD_FUNC
destroy_thread
(
switch_thread_t
*
thread
,
void
*
obj
)
{
struct
destroy_xml
*
dx
=
(
struct
destroy_xml
*
)
obj
;
switch_memory_pool_t
*
pool
=
dx
->
pool
;
switch_xml_free
(
dx
->
xml
);
switch_core_destroy_memory_pool
(
&
pool
);
return
NULL
;
}
SWITCH_DECLARE
(
void
)
switch_xml_free_in_thread
(
switch_xml_t
xml
,
int
stacksize
)
{
switch_thread_t
*
thread
;
switch_threadattr_t
*
thd_attr
;
switch_memory_pool_t
*
pool
=
NULL
;
struct
destroy_xml
*
dx
;
switch_core_new_memory_pool
(
&
pool
);
switch_threadattr_create
(
&
thd_attr
,
pool
);
switch_threadattr_detach_set
(
thd_attr
,
1
);
// TBD figure out how much space we need by looking at the xml_t when stacksize == 0
switch_threadattr_stacksize_set
(
thd_attr
,
stacksize
);
dx
=
switch_core_alloc
(
pool
,
sizeof
(
*
dx
));
dx
->
pool
=
pool
;
dx
->
xml
=
xml
;
switch_thread_create
(
&
thread
,
thd_attr
,
destroy_thread
,
dx
,
pool
);
}
static
char
not_so_threadsafe_error_buffer
[
256
]
=
""
;
static
char
not_so_threadsafe_error_buffer
[
256
]
=
""
;
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
,
const
char
**
err
)
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
,
const
char
**
err
)
...
@@ -1559,6 +1596,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
...
@@ -1559,6 +1596,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
MAIN_XML_ROOT
=
new_main
;
MAIN_XML_ROOT
=
new_main
;
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
switch_xml_free
(
old_root
);
switch_xml_free
(
old_root
);
//switch_xml_free_in_thread(old_root);
}
}
}
else
{
}
else
{
*
err
=
"Cannot Open log directory or XML Root!"
;
*
err
=
"Cannot Open log directory or XML Root!"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论