Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f9b32667
提交
f9b32667
authored
4月 12, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
endless recursion loop protection to go with new recursive variable expansion feature
上级
5f38a7f8
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
14 行删除
+22
-14
switch_channel.h
src/include/switch_channel.h
+2
-2
switch_event.h
src/include/switch_event.h
+2
-2
switch_channel.c
src/switch_channel.c
+9
-5
switch_event.c
src/switch_event.c
+9
-5
没有找到文件。
src/include/switch_channel.h
浏览文件 @
f9b32667
...
@@ -593,8 +593,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_
...
@@ -593,8 +593,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_
\return the original string if no expansion takes place otherwise a new string that must be freed
\return the original string if no expansion takes place otherwise a new string that must be freed
\note it's necessary to test if the return val is the same as the input and free the string if it is not.
\note it's necessary to test if the return val is the same as the input and free the string if it is not.
*/
*/
SWITCH_DECLARE
(
char
*
)
switch_channel_expand_variables_check
(
switch_channel_t
*
channel
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
);
SWITCH_DECLARE
(
char
*
)
switch_channel_expand_variables_check
(
switch_channel_t
*
channel
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
,
uint32_t
recur
);
#define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL)
#define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL
, 0
)
SWITCH_DECLARE
(
char
*
)
switch_channel_build_param_string
(
_In_
switch_channel_t
*
channel
,
_In_opt_
switch_caller_profile_t
*
caller_profile
,
SWITCH_DECLARE
(
char
*
)
switch_channel_build_param_string
(
_In_
switch_channel_t
*
channel
,
_In_opt_
switch_caller_profile_t
*
caller_profile
,
...
...
src/include/switch_event.h
浏览文件 @
f9b32667
...
@@ -330,8 +330,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, con
...
@@ -330,8 +330,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, con
SWITCH_DECLARE
(
switch_status_t
)
switch_event_set_body
(
switch_event_t
*
event
,
const
char
*
body
);
SWITCH_DECLARE
(
switch_status_t
)
switch_event_set_body
(
switch_event_t
*
event
,
const
char
*
body
);
SWITCH_DECLARE
(
char
*
)
switch_event_expand_headers_check
(
switch_event_t
*
event
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
);
SWITCH_DECLARE
(
char
*
)
switch_event_expand_headers_check
(
switch_event_t
*
event
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
,
uint32_t
recur
);
#define switch_event_expand_headers(_event, _in) switch_event_expand_headers_check(_event, _in, NULL, NULL)
#define switch_event_expand_headers(_event, _in) switch_event_expand_headers_check(_event, _in, NULL, NULL
, 0
)
SWITCH_DECLARE
(
switch_status_t
)
switch_event_create_pres_in_detailed
(
_In_z_
char
*
file
,
_In_z_
char
*
func
,
_In_
int
line
,
SWITCH_DECLARE
(
switch_status_t
)
switch_event_create_pres_in_detailed
(
_In_z_
char
*
file
,
_In_z_
char
*
func
,
_In_
int
line
,
_In_z_
const
char
*
proto
,
_In_z_
const
char
*
login
,
_In_z_
const
char
*
proto
,
_In_z_
const
char
*
login
,
...
...
src/switch_channel.c
浏览文件 @
f9b32667
...
@@ -3345,7 +3345,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
...
@@ -3345,7 +3345,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
memset(c, 0, olen - cpos);\
memset(c, 0, olen - cpos);\
}} \
}} \
SWITCH_DECLARE
(
char
*
)
switch_channel_expand_variables_check
(
switch_channel_t
*
channel
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
)
SWITCH_DECLARE
(
char
*
)
switch_channel_expand_variables_check
(
switch_channel_t
*
channel
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
,
uint32_t
recur
)
{
{
char
*
p
,
*
c
=
NULL
;
char
*
p
,
*
c
=
NULL
;
char
*
data
,
*
indup
,
*
endof_indup
;
char
*
data
,
*
indup
,
*
endof_indup
;
...
@@ -3354,6 +3354,10 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
...
@@ -3354,6 +3354,10 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
char
*
func_val
=
NULL
,
*
sb
=
NULL
;
char
*
func_val
=
NULL
,
*
sb
=
NULL
;
int
nv
=
0
;
int
nv
=
0
;
if
(
recur
>
100
)
{
return
(
char
*
)
in
;
}
if
(
zstr
(
in
))
{
if
(
zstr
(
in
))
{
return
(
char
*
)
in
;
return
(
char
*
)
in
;
}
}
...
@@ -3483,7 +3487,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
...
@@ -3483,7 +3487,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
char
*
ptr
;
char
*
ptr
;
int
idx
=
-
1
;
int
idx
=
-
1
;
if
((
expanded
=
switch_channel_expand_variables_check
(
channel
,
(
char
*
)
vname
,
var_list
,
api_list
))
==
vname
)
{
if
((
expanded
=
switch_channel_expand_variables_check
(
channel
,
(
char
*
)
vname
,
var_list
,
api_list
,
recur
+
1
))
==
vname
)
{
expanded
=
NULL
;
expanded
=
NULL
;
}
else
{
}
else
{
vname
=
expanded
;
vname
=
expanded
;
...
@@ -3508,7 +3512,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
...
@@ -3508,7 +3512,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
sub_val
=
"INVALID"
;
sub_val
=
"INVALID"
;
}
}
if
((
expanded_sub_val
=
switch_channel_expand_variables
(
channel
,
sub_val
))
==
sub_val
)
{
if
((
expanded_sub_val
=
switch_channel_expand_variables
_check
(
channel
,
sub_val
,
var_list
,
api_list
,
recur
+
1
))
==
sub_val
)
{
expanded_sub_val
=
NULL
;
expanded_sub_val
=
NULL
;
}
else
{
}
else
{
sub_val
=
expanded_sub_val
;
sub_val
=
expanded_sub_val
;
...
@@ -3547,13 +3551,13 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
...
@@ -3547,13 +3551,13 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c
if
(
stream
.
data
)
{
if
(
stream
.
data
)
{
char
*
expanded_vname
=
NULL
;
char
*
expanded_vname
=
NULL
;
if
((
expanded_vname
=
switch_channel_expand_variables_check
(
channel
,
(
char
*
)
vname
,
var_list
,
api_list
))
==
vname
)
{
if
((
expanded_vname
=
switch_channel_expand_variables_check
(
channel
,
(
char
*
)
vname
,
var_list
,
api_list
,
recur
+
1
))
==
vname
)
{
expanded_vname
=
NULL
;
expanded_vname
=
NULL
;
}
else
{
}
else
{
vname
=
expanded_vname
;
vname
=
expanded_vname
;
}
}
if
((
expanded
=
switch_channel_expand_variables_check
(
channel
,
vval
,
var_list
,
api_list
))
==
vval
)
{
if
((
expanded
=
switch_channel_expand_variables_check
(
channel
,
vval
,
var_list
,
api_list
,
recur
+
1
))
==
vval
)
{
expanded
=
NULL
;
expanded
=
NULL
;
}
else
{
}
else
{
vval
=
expanded
;
vval
=
expanded
;
...
...
src/switch_event.c
浏览文件 @
f9b32667
...
@@ -1992,7 +1992,7 @@ if ((dp = realloc(data, olen))) {\
...
@@ -1992,7 +1992,7 @@ if ((dp = realloc(data, olen))) {\
memset(c, 0, olen - cpos);\
memset(c, 0, olen - cpos);\
}} \
}} \
SWITCH_DECLARE
(
char
*
)
switch_event_expand_headers_check
(
switch_event_t
*
event
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
)
SWITCH_DECLARE
(
char
*
)
switch_event_expand_headers_check
(
switch_event_t
*
event
,
const
char
*
in
,
switch_event_t
*
var_list
,
switch_event_t
*
api_list
,
uint32_t
recur
)
{
{
char
*
p
,
*
c
=
NULL
;
char
*
p
,
*
c
=
NULL
;
char
*
data
,
*
indup
,
*
endof_indup
;
char
*
data
,
*
indup
,
*
endof_indup
;
...
@@ -2003,6 +2003,10 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
...
@@ -2003,6 +2003,10 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
int
nv
=
0
;
int
nv
=
0
;
char
*
gvar
=
NULL
,
*
sb
=
NULL
;
char
*
gvar
=
NULL
,
*
sb
=
NULL
;
if
(
recur
>
100
)
{
return
(
char
*
)
in
;
}
if
(
zstr
(
in
))
{
if
(
zstr
(
in
))
{
return
(
char
*
)
in
;
return
(
char
*
)
in
;
}
}
...
@@ -2132,7 +2136,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
...
@@ -2132,7 +2136,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
char
*
ptr
;
char
*
ptr
;
int
idx
=
-
1
;
int
idx
=
-
1
;
if
((
expanded
=
switch_event_expand_headers_check
(
event
,
(
char
*
)
vname
,
var_list
,
api_list
))
==
vname
)
{
if
((
expanded
=
switch_event_expand_headers_check
(
event
,
(
char
*
)
vname
,
var_list
,
api_list
,
recur
+
1
))
==
vname
)
{
expanded
=
NULL
;
expanded
=
NULL
;
}
else
{
}
else
{
vname
=
expanded
;
vname
=
expanded
;
...
@@ -2162,7 +2166,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
...
@@ -2162,7 +2166,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
}
}
if
((
expanded_sub_val
=
switch_event_expand_headers
(
event
,
sub_val
))
==
sub_val
)
{
if
((
expanded_sub_val
=
switch_event_expand_headers
_check
(
event
,
sub_val
,
var_list
,
api_list
,
recur
+
1
))
==
sub_val
)
{
expanded_sub_val
=
NULL
;
expanded_sub_val
=
NULL
;
}
else
{
}
else
{
sub_val
=
expanded_sub_val
;
sub_val
=
expanded_sub_val
;
...
@@ -2198,13 +2202,13 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
...
@@ -2198,13 +2202,13 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event,
if
(
stream
.
data
)
{
if
(
stream
.
data
)
{
char
*
expanded_vname
=
NULL
;
char
*
expanded_vname
=
NULL
;
if
((
expanded_vname
=
switch_event_expand_headers_check
(
event
,
(
char
*
)
vname
,
var_list
,
api_list
))
==
vname
)
{
if
((
expanded_vname
=
switch_event_expand_headers_check
(
event
,
(
char
*
)
vname
,
var_list
,
api_list
,
recur
+
1
))
==
vname
)
{
expanded_vname
=
NULL
;
expanded_vname
=
NULL
;
}
else
{
}
else
{
vname
=
expanded_vname
;
vname
=
expanded_vname
;
}
}
if
((
expanded
=
switch_event_expand_headers_check
(
event
,
vval
,
var_list
,
api_list
))
==
vval
)
{
if
((
expanded
=
switch_event_expand_headers_check
(
event
,
vval
,
var_list
,
api_list
,
recur
+
1
))
==
vval
)
{
expanded
=
NULL
;
expanded
=
NULL
;
}
else
{
}
else
{
vval
=
expanded
;
vval
=
expanded
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论