Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-07-21 10:50:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1b1dc0c64c57d55d2909b224fc46a561a6ada4a
f1b1dc0c
1 parent
ffa72d35
add utest for config full.conf, fix the chunk-size bug
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
26 行增加
和
8 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/utest/srs_utest_config.cpp
trunk/src/app/srs_app_config.cpp
查看文件 @
f1b1dc0
...
...
@@ -1587,27 +1587,38 @@ SrsConfDirective* SrsConfig::get_refer_publish(string vhost)
int
SrsConfig
::
get_chunk_size
(
string
vhost
)
{
if
(
vhost
.
empty
())
{
return
get_global_chunk_size
();
}
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
if
(
!
conf
)
{
return
SRS_CONSTS_RTMP_SRS_CHUNK_SIZE
;
// vhost does not specify the chunk size,
// use the global instead.
return
get_global_chunk_size
();
}
conf
=
conf
->
get
(
"chunk_size"
);
if
(
!
conf
)
{
// vhost does not specify the chunk size,
// use the global instead.
conf
=
root
->
get
(
"chunk_size"
);
if
(
!
conf
)
{
return
SRS_CONSTS_RTMP_SRS_CHUNK_SIZE
;
}
return
::
atoi
(
conf
->
arg0
().
c_str
());
return
get_global_chunk_size
();
}
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
int
SrsConfig
::
get_global_chunk_size
()
{
SrsConfDirective
*
conf
=
root
->
get
(
"chunk_size"
);
if
(
!
conf
)
{
return
SRS_CONSTS_RTMP_SRS_CHUNK_SIZE
;
}
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
SrsConfDirective
*
SrsConfig
::
get_forward
(
string
vhost
)
{
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
f1b1dc0
...
...
@@ -490,12 +490,19 @@ public:
virtual
SrsConfDirective
*
get_refer_publish
(
std
::
string
vhost
);
/**
* get the chunk size of vhost.
* @param vhost, the vhost to get the chunk size. use global if not specified.
* empty string to get the global.
*/
virtual
int
get_chunk_size
(
std
::
string
vhost
);
private
:
/**
* get the global chunk size.
*/
virtual
int
get_global_chunk_size
();
// forward section
public:
/**
*
*
get the forward directive of vhost.
*/
virtual
SrsConfDirective
*
get_forward
(
std
::
string
vhost
);
// http_hooks section
...
...
trunk/src/utest/srs_utest_config.cpp
查看文件 @
f1b1dc0
此 diff 太大无法显示。
请
注册
或
登录
后发表评论