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-04-13 16:55:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a0472f256d7d385d2f3a5e388191d65efa61ade2
a0472f25
1 parent
f980340e
support test config file. change to 0.9.61
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
33 行增加
和
12 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/core/srs_core.hpp
trunk/src/app/srs_app_config.cpp
查看文件 @
a0472f2
...
...
@@ -436,6 +436,7 @@ SrsConfig::SrsConfig()
{
show_help
=
false
;
show_version
=
false
;
test_conf
=
false
;
root
=
new
SrsConfDirective
();
root
->
conf_line
=
0
;
...
...
@@ -1073,13 +1074,11 @@ int SrsConfig::parse_options(int argc, char** argv)
if
(
show_help
)
{
print_help
(
argv
);
exit
(
0
);
}
if
(
show_version
)
{
fprintf
(
stderr
,
"%s
\n
"
,
RTMP_SIG_SRS_VERSION
);
}
if
(
show_help
||
show_version
)
{
exit
(
0
);
}
...
...
@@ -1089,7 +1088,19 @@ int SrsConfig::parse_options(int argc, char** argv)
return
ret
;
}
return
parse_file
(
config_file
.
c_str
());
ret
=
parse_file
(
config_file
.
c_str
());
if
(
test_conf
)
{
if
(
ret
==
ERROR_SUCCESS
)
{
srs_trace
(
"config file is ok"
);
exit
(
0
);
}
else
{
srs_error
(
"config file is invalid"
);
exit
(
ret
);
}
}
return
ret
;
}
int
SrsConfig
::
parse_file
(
const
char
*
filename
)
...
...
@@ -1154,6 +1165,10 @@ int SrsConfig::parse_argv(int& i, char** argv)
case
'h'
:
show_help
=
true
;
break
;
case
't'
:
show_help
=
false
;
test_conf
=
true
;
break
;
case
'v'
:
case
'V'
:
show_help
=
false
;
...
...
@@ -1188,19 +1203,23 @@ void SrsConfig::print_help(char** argv)
RTMP_SIG_SRS_NAME
" "
RTMP_SIG_SRS_VERSION
" "
RTMP_SIG_SRS_COPYRIGHT
"
\n
"
"Primary Authors: "
RTMP_SIG_SRS_PRIMARY_AUTHROS
"
\n
"
"Build: "
SRS_BUILD_DATE
" Configuration:"
SRS_CONFIGURE
"
\n
"
"Usage: %s [-h?vV
t] [
-c <filename>]
\n
"
"Usage: %s [-h?vV
] [[-t]
-c <filename>]
\n
"
"
\n
"
"Options:
\n
"
" -?, -h : show help
\n
"
" -v, -V : show version and exit
\n
"
" -t : test configuration file
\n
"
" -c filename : set configuration file
\n
"
" -?, -h : show this help and exit(0)
\n
"
" -v, -V : show version and exit(0)
\n
"
" -t : test configuration file, exit(error_code).
\n
"
" -c filename : use configuration file for SRS
\n
"
"
\n
"
RTMP_SIG_SRS_WEB
"
\n
"
RTMP_SIG_SRS_URL
"
\n
"
"Email: "
RTMP_SIG_SRS_EMAIL
"
\n
"
"
\n
"
,
argv
[
0
]);
"
\n
"
"For example:
\n
"
" %s -v
\n
"
" %s -t -c "
SRS_DEFAULT_CONF
"
\n
"
" %s -c "
SRS_DEFAULT_CONF
"
\n
"
,
argv
[
0
],
argv
[
0
],
argv
[
0
],
argv
[
0
]);
}
bool
SrsConfig
::
get_deamon
()
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
a0472f2
...
...
@@ -39,6 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_LOCALHOST "127.0.0.1"
#define SRS_CONF_DEFAULT_PID_FILE "./objs/srs.pid"
#define SRS_DEFAULT_CONF "conf/srs.conf"
#define SRS_CONF_DEFAULT_HLS_PATH "./objs/nginx/html"
#define SRS_CONF_DEFAULT_HLS_FRAGMENT 10
...
...
@@ -111,6 +112,7 @@ class SrsConfig
{
private
:
bool
show_help
;
bool
test_conf
;
bool
show_version
;
std
::
string
config_file
;
SrsConfDirective
*
root
;
...
...
trunk/src/core/srs_core.hpp
查看文件 @
a0472f2
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "6
0
"
#define VERSION_REVISION "6
1
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
请
注册
或
登录
后发表评论