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
2013-12-15 12:08:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7622878979c9a5dcc554dd58b8271e39f0b7db16
76228789
1 parent
2f397d04
support reload the gop_cache
显示空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
24 行增加
和
2 行删除
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_config.cpp
trunk/src/core/srs_core_reload.cpp
trunk/src/core/srs_core_reload.hpp
trunk/src/core/srs_core_source.cpp
trunk/src/core/srs_core_client.cpp
查看文件 @
7622878
...
...
@@ -63,6 +63,8 @@ SrsClient::SrsClient(SrsServer* srs_server, st_netfd_t client_stfd)
SrsClient
::~
SrsClient
()
{
config
->
unsubscribe
(
this
);
srs_freepa
(
ip
);
srs_freep
(
req
);
srs_freep
(
res
);
...
...
@@ -71,8 +73,6 @@ SrsClient::~SrsClient()
#ifdef SRS_HTTP
srs_freep
(
http_hooks
);
#endif
config
->
unsubscribe
(
this
);
}
// TODO: return detail message when error for client.
...
...
trunk/src/core/srs_core_config.cpp
查看文件 @
7622878
...
...
@@ -537,6 +537,7 @@ 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
))
{
// gop_cache
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"gop_cache"
),
old_vhost
->
get
(
"gop_cache"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
ISrsReloadHandler
*
subscribe
=
*
it
;
...
...
@@ -547,6 +548,17 @@ int SrsConfig::reload()
}
srs_trace
(
"vhost %s reload gop_cache success."
,
vhost
.
c_str
());
}
// forward
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"forward"
),
old_vhost
->
get
(
"forward"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
ISrsReloadHandler
*
subscribe
=
*
it
;
if
((
ret
=
subscribe
->
on_reload_forward
(
vhost
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"vhost %s notify subscribes forward failed. ret=%d"
,
vhost
.
c_str
(),
ret
);
return
ret
;
}
}
srs_trace
(
"vhost %s reload forward success."
,
vhost
.
c_str
());
}
// TODO: suppor reload hls/forward/ffmpeg/http
continue
;
}
...
...
trunk/src/core/srs_core_reload.cpp
查看文件 @
7622878
...
...
@@ -55,3 +55,8 @@ int ISrsReloadHandler::on_reload_gop_cache(string /*vhost*/)
return
ERROR_SUCCESS
;
}
int
ISrsReloadHandler
::
on_reload_forward
(
string
/*vhost*/
)
{
return
ERROR_SUCCESS
;
}
...
...
trunk/src/core/srs_core_reload.hpp
查看文件 @
7622878
...
...
@@ -44,6 +44,7 @@ public:
virtual
int
on_reload_pithy_print
();
virtual
int
on_reload_vhost_removed
(
std
::
string
vhost
);
virtual
int
on_reload_gop_cache
(
std
::
string
vhost
);
virtual
int
on_reload_forward
(
std
::
string
vhost
);
};
#endif
\ No newline at end of file
...
...
trunk/src/core/srs_core_source.cpp
查看文件 @
7622878
...
...
@@ -374,10 +374,14 @@ SrsSource::SrsSource(string _stream_url, string _vhost)
_can_publish
=
true
;
gop_cache
=
new
SrsGopCache
();
config
->
subscribe
(
this
);
}
SrsSource
::~
SrsSource
()
{
config
->
unsubscribe
(
this
);
if
(
true
)
{
std
::
vector
<
SrsConsumer
*>::
iterator
it
;
for
(
it
=
consumers
.
begin
();
it
!=
consumers
.
end
();
++
it
)
{
...
...
请
注册
或
登录
后发表评论