Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
76b63d3a
提交
76b63d3a
authored
4月 26, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1264
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
b81e4d6c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
23 行删除
+22
-23
switch.c
src/switch.c
+13
-12
switch_core.c
src/switch_core.c
+8
-11
switch_log.c
src/switch_log.c
+1
-0
没有找到文件。
src/switch.c
浏览文件 @
76b63d3a
...
...
@@ -107,6 +107,19 @@ int main(int argc, char *argv[])
if
(
bg
)
{
//snprintf(path, sizeof(path), "%s%c%s", SWITCH_GLOBAL_dirs.log_dir, sep, lfile);
ppath
=
lfile
;
signal
(
SIGHUP
,
(
void
*
)
handle_SIGHUP
);
signal
(
SIGTERM
,
(
void
*
)
handle_SIGHUP
);
#ifdef WIN32
FreeConsole
();
#else
if
((
pid
=
fork
()))
{
fprintf
(
stderr
,
"%d Backgrounding.
\n
"
,
(
int
)
pid
);
exit
(
0
);
}
#endif
}
...
...
@@ -132,19 +145,7 @@ int main(int argc, char *argv[])
if
(
bg
)
{
signal
(
SIGHUP
,
(
void
*
)
handle_SIGHUP
);
signal
(
SIGTERM
,
(
void
*
)
handle_SIGHUP
);
#ifdef WIN32
FreeConsole
();
#else
if
((
pid
=
fork
()))
{
fprintf
(
stderr
,
"%d Backgrounding.
\n
"
,
(
int
)
pid
);
exit
(
0
);
}
#endif
}
snprintf
(
path
,
sizeof
(
path
),
"%s%s%s"
,
SWITCH_GLOBAL_dirs
.
log_dir
,
SWITCH_PATH_SEPARATOR
,
pfile
);
if
((
f
=
fopen
(
path
,
"w"
))
==
0
)
{
...
...
src/switch_core.c
浏览文件 @
76b63d3a
...
...
@@ -2361,10 +2361,10 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, vo
switch_time_t
last_commit
=
switch_time_now
();
uint32_t
work
=
0
,
freq
=
1000
,
target
=
500
,
diff
=
0
;
if
(
!
runtime
.
event_db
)
{
runtime
.
event_db
=
switch_core_db_handle
();
}
runtime
.
event_db
=
switch_core_db_handle
();
switch_queue_create
(
&
runtime
.
sql_queue
,
SWITCH_SQL_QUEUE_LEN
,
runtime
.
memory_pool
);
for
(;;)
{
if
(
switch_queue_trypop
(
runtime
.
sql_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
char
*
sql
=
(
char
*
)
pop
;
...
...
@@ -2565,18 +2565,15 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
/* INIT APR and Create the pool context */
if
(
apr_initialize
()
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
();
fprintf
(
stderr
,
"FATAL ERROR! Could not initilize APR
\n
"
);
return
SWITCH_STATUS_MEMERR
;
}
if
(
apr_pool_create
(
&
runtime
.
memory_pool
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"
Could not allocate memory pool
\n
"
);
fprintf
(
stderr
,
"FATAL ERROR!
Could not allocate memory pool
\n
"
);
switch_core_destroy
();
return
SWITCH_STATUS_MEMERR
;
}
assert
(
runtime
.
memory_pool
!=
NULL
);
switch_log_init
(
runtime
.
memory_pool
);
switch_core_sql_thread_launch
();
if
(
console
)
{
if
(
*
console
!=
'/'
)
{
...
...
@@ -2589,9 +2586,9 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
runtime
.
console
=
stdout
;
}
switch_
queue_create
(
&
runtime
.
sql_queue
,
SWITCH_SQL_QUEUE_LEN
,
runtime
.
memory_pool
);
assert
(
runtime
.
memory_pool
!=
NULL
);
switch_
log_init
(
runtime
.
memory_pool
);
switch_core_sql_thread_launch
();
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Allocated memory pool. Sessions are %u bytes
\n
"
,
sizeof
(
struct
switch_core_session
));
switch_event_init
(
runtime
.
memory_pool
);
...
...
src/switch_log.c
浏览文件 @
76b63d3a
...
...
@@ -156,6 +156,7 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread *thread, void *obj)
free
(
node
);
}
}
THREAD_RUNNING
=
0
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Logger Ended.
\n
"
);
return
NULL
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论