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-12 22:00:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
821b58af0306f7a15eac3578e77b24680b6c1584
821b58af
1 parent
eda1ddc0
support reload atc
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
40 行增加
和
2 行删除
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_reload.cpp
trunk/src/app/srs_app_reload.hpp
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.hpp
trunk/conf/full.conf
查看文件 @
821b58a
...
...
@@ -38,6 +38,7 @@ srs_log_file ./objs/srs.log;
# default: 2000
max_connections
1000
;
# whether start as deamon
# @remark: donot support reload.
# default: on
daemon
on
;
...
...
@@ -66,7 +67,7 @@ http_api {
# user can access the http server pages, generally:
# curl http://192.168.1.170:80/srs.html
# which will show srs version and welcome to srs.
# @rem
e
ark, the http embeded stream need to config the vhost, for instance, the __defaultVhost__
# @remark, the http embeded stream need to config the vhost, for instance, the __defaultVhost__
# need to open the feature http of vhost.
http_stream
{
# whether http streaming service is enabled.
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
821b58a
...
...
@@ -554,7 +554,7 @@ int SrsConfig::reload()
}
// directly supported for reload:
// chunk_size, ff_log_dir
// chunk_size, ff_log_dir
, max_connections
// merge config: pithy_print
if
(
!
srs_directive_equals
(
root
->
get
(
"pithy_print"
),
old_root
->
get
(
"pithy_print"
)))
{
...
...
@@ -643,6 +643,17 @@ int SrsConfig::reload()
// merge config: vhost modified.
srs_trace
(
"vhost %s modified, reload its detail."
,
vhost
.
c_str
());
if
(
get_vhost_enabled
(
new_vhost
)
&&
get_vhost_enabled
(
old_vhost
))
{
// atc, only one per vhost
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"atc"
),
old_vhost
->
get
(
"atc"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
ISrsReloadHandler
*
subscribe
=
*
it
;
if
((
ret
=
subscribe
->
on_reload_atc
(
vhost
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"vhost %s notify subscribes atc failed. ret=%d"
,
vhost
.
c_str
(),
ret
);
return
ret
;
}
}
srs_trace
(
"vhost %s reload atc success."
,
vhost
.
c_str
());
}
// gop_cache, only one per vhost
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"gop_cache"
),
old_vhost
->
get
(
"gop_cache"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
...
...
trunk/src/app/srs_app_reload.cpp
查看文件 @
821b58a
...
...
@@ -75,6 +75,11 @@ int ISrsReloadHandler::on_reload_vhost_removed(string /*vhost*/)
return
ERROR_SUCCESS
;
}
int
ISrsReloadHandler
::
on_reload_atc
(
string
/*vhost*/
)
{
return
ERROR_SUCCESS
;
}
int
ISrsReloadHandler
::
on_reload_gop_cache
(
string
/*vhost*/
)
{
return
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_reload.hpp
查看文件 @
821b58a
...
...
@@ -49,6 +49,7 @@ public:
virtual
int
on_reload_pithy_print
();
virtual
int
on_reload_vhost_added
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_removed
(
std
::
string
vhost
);
virtual
int
on_reload_atc
(
std
::
string
vhost
);
virtual
int
on_reload_gop_cache
(
std
::
string
vhost
);
virtual
int
on_reload_queue_length
(
std
::
string
vhost
);
virtual
int
on_reload_forward
(
std
::
string
vhost
);
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
821b58a
...
...
@@ -484,6 +484,25 @@ SrsSource::~SrsSource()
srs_freep
(
req
);
}
int
SrsSource
::
on_reload_atc
(
string
vhost
)
{
int
ret
=
ERROR_SUCCESS
;
if
(
req
->
vhost
!=
vhost
)
{
return
ret
;
}
// atc changed.
bool
enabled_atc
=
_srs_config
->
get_atc
(
vhost
);
srs_warn
(
"vhost %s atc changed to %d, connected client may corrupt."
,
vhost
.
c_str
(),
enabled_atc
);
gop_cache
->
clear
();
return
ret
;
}
int
SrsSource
::
on_reload_gop_cache
(
string
vhost
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_source.hpp
查看文件 @
821b58a
...
...
@@ -266,6 +266,7 @@ public:
virtual
~
SrsSource
();
// interface ISrsReloadHandler
public:
virtual
int
on_reload_atc
(
std
::
string
vhost
);
virtual
int
on_reload_gop_cache
(
std
::
string
vhost
);
virtual
int
on_reload_queue_length
(
std
::
string
vhost
);
virtual
int
on_reload_forward
(
std
::
string
vhost
);
...
...
请
注册
或
登录
后发表评论