Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
2ec2a9b0
提交
2ec2a9b0
authored
2月 04, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skip blocking writes on fs_cli to avoid backing up event socket
上级
46f6c6e4
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
9 行删除
+28
-9
fs_cli.c
libs/esl/fs_cli.c
+28
-9
没有找到文件。
libs/esl/fs_cli.c
浏览文件 @
2ec2a9b0
...
@@ -589,22 +589,36 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
...
@@ -589,22 +589,36 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
while
(
thread_running
&&
handle
->
connected
)
{
while
(
thread_running
&&
handle
->
connected
)
{
esl_status_t
status
=
esl_recv_event_timed
(
handle
,
10
,
1
,
NULL
);
esl_status_t
status
=
esl_recv_event_timed
(
handle
,
10
,
1
,
NULL
);
int
aok
=
1
;
if
(
WARN_STOP
)
{
printf
(
"Type control-D or /exit or /quit or /bye to exit.
\n\n
"
);
WARN_STOP
=
0
;
}
if
(
status
==
ESL_FAIL
)
{
if
(
status
==
ESL_FAIL
)
{
esl_log
(
ESL_LOG_WARNING
,
"Disconnected.
\n
"
);
if
(
aok
)
esl_log
(
ESL_LOG_WARNING
,
"Disconnected.
\n
"
);
running
=
-
1
;
thread_running
=
0
;
running
=
-
1
;
thread_running
=
0
;
}
else
if
(
status
==
ESL_SUCCESS
)
{
}
else
if
(
status
==
ESL_SUCCESS
)
{
#ifndef WIN32
fd_set
can_write
;
int
fd
;
struct
timeval
to
;
fd
=
fileno
(
stdout
);
memset
(
&
to
,
0
,
sizeof
(
to
));
FD_ZERO
(
&
can_write
);
FD_SET
(
fd
,
&
can_write
);
to
.
tv_sec
=
0
;
to
.
tv_usec
=
100000
;
if
(
select
(
fd
+
1
,
NULL
,
&
can_write
,
NULL
,
&
to
)
>
0
)
{
aok
=
FD_ISSET
(
fd
,
&
can_write
);
}
else
{
aok
=
0
;
}
#endif
if
(
handle
->
last_event
)
{
if
(
handle
->
last_event
)
{
const
char
*
type
=
esl_event_get_header
(
handle
->
last_event
,
"content-type"
);
const
char
*
type
=
esl_event_get_header
(
handle
->
last_event
,
"content-type"
);
int
known
=
0
;
int
known
=
0
;
if
(
!
esl_strlen_zero
(
type
))
{
if
(
!
esl_strlen_zero
(
type
))
{
if
(
!
strcasecmp
(
type
,
"log/data"
))
{
if
(
aok
&&
!
strcasecmp
(
type
,
"log/data"
))
{
const
char
*
userdata
=
esl_event_get_header
(
handle
->
last_event
,
"user-data"
);
const
char
*
userdata
=
esl_event_get_header
(
handle
->
last_event
,
"user-data"
);
if
(
esl_strlen_zero
(
userdata
)
||
esl_strlen_zero
(
filter_uuid
)
||
!
strcasecmp
(
filter_uuid
,
userdata
))
{
if
(
esl_strlen_zero
(
userdata
)
||
esl_strlen_zero
(
filter_uuid
)
||
!
strcasecmp
(
filter_uuid
,
userdata
))
{
...
@@ -631,7 +645,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
...
@@ -631,7 +645,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
}
else
if
(
!
strcasecmp
(
type
,
"text/disconnect-notice"
))
{
}
else
if
(
!
strcasecmp
(
type
,
"text/disconnect-notice"
))
{
running
=
-
1
;
thread_running
=
0
;
running
=
-
1
;
thread_running
=
0
;
known
++
;
known
++
;
}
else
if
(
!
strcasecmp
(
type
,
"text/event-plain"
))
{
}
else
if
(
aok
&&
!
strcasecmp
(
type
,
"text/event-plain"
))
{
char
*
foo
;
char
*
foo
;
esl_event_serialize
(
handle
->
last_ievent
,
&
foo
,
ESL_FALSE
);
esl_event_serialize
(
handle
->
last_ievent
,
&
foo
,
ESL_FALSE
);
printf
(
"RECV EVENT
\n
%s
\n
"
,
foo
);
printf
(
"RECV EVENT
\n
%s
\n
"
,
foo
);
...
@@ -641,7 +655,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
...
@@ -641,7 +655,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
}
}
}
}
if
(
!
known
)
{
if
(
aok
&&
!
known
)
{
char
*
foo
;
char
*
foo
;
printf
(
"INCOMING DATA [%s]
\n
%s
\n
"
,
type
,
handle
->
last_event
->
body
?
handle
->
last_event
->
body
:
""
);
printf
(
"INCOMING DATA [%s]
\n
%s
\n
"
,
type
,
handle
->
last_event
->
body
?
handle
->
last_event
->
body
:
""
);
esl_event_serialize
(
handle
->
last_event
,
&
foo
,
ESL_FALSE
);
esl_event_serialize
(
handle
->
last_event
,
&
foo
,
ESL_FALSE
);
...
@@ -651,6 +665,11 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
...
@@ -651,6 +665,11 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
}
}
}
}
if
(
WARN_STOP
)
{
if
(
aok
)
printf
(
"Type control-D or /exit or /quit or /bye to exit.
\n\n
"
);
WARN_STOP
=
0
;
}
usleep
(
1000
);
usleep
(
1000
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论