Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5b2dc5b9
提交
5b2dc5b9
authored
3月 10, 2014
作者:
Tamas Cseke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lot of event can cause api timeout FS-3347
make event and log bulk configurable
上级
beae3aed
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
3 行删除
+12
-3
mod_erlang_event.c
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
+10
-3
mod_erlang_event.h
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h
+2
-0
没有找到文件。
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
浏览文件 @
5b2dc5b9
...
@@ -755,7 +755,7 @@ static int check_log_queue(listener_t *listener)
...
@@ -755,7 +755,7 @@ static int check_log_queue(listener_t *listener)
/* send out any pending crap in the log queue */
/* send out any pending crap in the log queue */
if
(
switch_test_flag
(
listener
,
LFLAG_LOG
))
{
if
(
switch_test_flag
(
listener
,
LFLAG_LOG
))
{
while
(
msgs_sent
<
100
&&
switch_queue_trypop
(
listener
->
log_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
while
(
msgs_sent
<
prefs
.
max_log_bulk
&&
switch_queue_trypop
(
listener
->
log_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_node_t
*
dnode
=
(
switch_log_node_t
*
)
pop
;
switch_log_node_t
*
dnode
=
(
switch_log_node_t
*
)
pop
;
if
(
dnode
->
data
)
{
if
(
dnode
->
data
)
{
...
@@ -817,7 +817,7 @@ static int check_event_queue(listener_t *listener)
...
@@ -817,7 +817,7 @@ static int check_event_queue(listener_t *listener)
/* send out any pending crap in the event queue */
/* send out any pending crap in the event queue */
if
(
switch_test_flag
(
listener
,
LFLAG_EVENTS
))
{
if
(
switch_test_flag
(
listener
,
LFLAG_EVENTS
))
{
while
(
msgs_sent
<
100
&&
switch_queue_trypop
(
listener
->
event_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
while
(
msgs_sent
<
prefs
.
max_event_bulk
&&
switch_queue_trypop
(
listener
->
event_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_t
*
pevent
=
(
switch_event_t
*
)
pop
;
switch_event_t
*
pevent
=
(
switch_event_t
*
)
pop
;
...
@@ -998,7 +998,7 @@ static void listener_main_loop(listener_t *listener)
...
@@ -998,7 +998,7 @@ static void listener_main_loop(listener_t *listener)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%d messages sent in a loop
\n
"
,
msgs_sent
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%d messages sent in a loop
\n
"
,
msgs_sent
);
#endif
#endif
}
else
{
/* no more messages right now, relax */
}
else
{
/* no more messages right now, relax */
switch_yield
(
10000
0
);
switch_yield
(
10000
);
}
}
}
}
if
(
prefs
.
done
)
{
if
(
prefs
.
done
)
{
...
@@ -1157,6 +1157,9 @@ static int config(void)
...
@@ -1157,6 +1157,9 @@ static int config(void)
prefs
.
shortname
=
SWITCH_TRUE
;
prefs
.
shortname
=
SWITCH_TRUE
;
prefs
.
encoding
=
ERLANG_STRING
;
prefs
.
encoding
=
ERLANG_STRING
;
prefs
.
compat_rel
=
0
;
prefs
.
compat_rel
=
0
;
prefs
.
max_event_bulk
=
1
;
prefs
.
max_log_bulk
=
1
;
if
(
!
(
xml
=
switch_xml_open_cfg
(
cf
,
&
cfg
,
NULL
)))
{
if
(
!
(
xml
=
switch_xml_open_cfg
(
cf
,
&
cfg
,
NULL
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Open of %s failed
\n
"
,
cf
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Open of %s failed
\n
"
,
cf
);
...
@@ -1199,6 +1202,10 @@ static int config(void)
...
@@ -1199,6 +1202,10 @@ static int config(void)
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Max acl records of %d reached
\n
"
,
MAX_ACL
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Max acl records of %d reached
\n
"
,
MAX_ACL
);
}
}
}
else
if
(
!
strcasecmp
(
var
,
"max-event-bulk"
)
&&
!
zstr
(
val
))
{
prefs
.
max_event_bulk
=
atoi
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"max-log-bulk"
)
&&
!
zstr
(
val
))
{
prefs
.
max_log_bulk
=
atoi
(
val
);
}
}
}
}
}
}
...
...
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h
浏览文件 @
5b2dc5b9
...
@@ -216,6 +216,8 @@ struct prefs_struct {
...
@@ -216,6 +216,8 @@ struct prefs_struct {
uint32_t
id
;
uint32_t
id
;
erlang_encoding_t
encoding
;
erlang_encoding_t
encoding
;
int
compat_rel
;
int
compat_rel
;
int
max_event_bulk
;
int
max_log_bulk
;
};
};
typedef
struct
prefs_struct
prefs_t
;
typedef
struct
prefs_struct
prefs_t
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论