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
2016-09-23 14:53:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a01540433ebd4f65968cf4d7c4ab644c8563ffa
2a015404
1 parent
9bd2ff16
support change work_dir for oryx.
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
31 行增加
和
1 行删除
README.md
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/main/srs_main_server.cpp
README.md
查看文件 @
2a01540
...
...
@@ -343,6 +343,7 @@ Remark:
## History
*
v2.0, 2016-09-23, support change work_dir for oryx.
*
v2.0, 2016-09-15, fix #640, typo for rtmp type. 2.0.217
*
v2.0, 2016-09-12, fix fast stream error bug. 2.0.216
*
<strong>
v2.0, 2016-09-09,
[
2.0 beta1(2.0.215)
][
r2.0b1
]
released. 89941 lines.
</strong>
...
...
trunk/conf/full.conf
查看文件 @
2a01540
...
...
@@ -50,6 +50,12 @@ daemon on;
# default: off
utc_time
off
;
# the work dir for server, to chdir(work_dir) when not empty or "./"
# user can config this directory to change the dir.
# @reamrk do not support reload.
# default: ./
work_dir
./;
#############################################################################################
# heartbeat/stats sections
#############################################################################################
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
2a01540
...
...
@@ -1567,7 +1567,7 @@ int SrsConfig::check_config()
&&
n
!=
"max_connections"
&&
n
!=
"daemon"
&&
n
!=
"heartbeat"
&&
n
!=
"http_api"
&&
n
!=
"stats"
&&
n
!=
"vhost"
&&
n
!=
"pithy_print_ms"
&&
n
!=
"http_stream"
&&
n
!=
"http_server"
&&
n
!=
"stream_caster"
&&
n
!=
"utc_time"
&&
n
!=
"utc_time"
&&
n
!=
"work_dir"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"unsupported directive %s, ret=%d"
,
n
.
c_str
(),
ret
);
...
...
@@ -2172,6 +2172,17 @@ bool SrsConfig::get_utc_time()
return
SRS_CONF_PERFER_FALSE
(
conf
->
arg0
());
}
string
SrsConfig
::
get_work_dir
()
{
static
string
DEFAULT
=
"./"
;
SrsConfDirective
*
conf
=
root
->
get
(
"work_dir"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
}
return
conf
->
arg0
();
}
vector
<
SrsConfDirective
*>
SrsConfig
::
get_stream_casters
()
{
srs_assert
(
root
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
2a01540
...
...
@@ -374,6 +374,11 @@ public:
* whether use utc-time to format the time.
*/
virtual
bool
get_utc_time
();
/**
* get the configed work dir.
* ignore if empty string.
*/
virtual
std
::
string
get_work_dir
();
// stream_caster section
public:
/**
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
2a01540
...
...
@@ -282,6 +282,13 @@ int main(int argc, char** argv)
return
ret
;
}
// change the work dir and set cwd.
std
::
string
cwd
=
_srs_config
->
get_work_dir
();
if
(
!
cwd
.
empty
()
&&
cwd
!=
"./"
&&
(
ret
=
chdir
(
cwd
.
c_str
()))
!=
ERROR_SUCCESS
)
{
srs_error
(
"change cwd to %s failed. ret=%d"
,
cwd
.
c_str
(),
ret
);
return
ret
;
}
// config parsed, initialize log.
if
((
ret
=
_srs_log
->
initialize
())
!=
ERROR_SUCCESS
)
{
return
ret
;
...
...
请
注册
或
登录
后发表评论