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-28 17:57:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
23b04e2a574132fc967f2b7d7d604211279c1d5c
23b04e2a
1 parent
c6810989
completed the edge reload, to 0.9.79
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
25 行增加
和
5 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_edge.cpp
trunk/src/app/srs_app_edge.hpp
trunk/src/app/srs_app_reload.hpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_error.hpp
trunk/src/app/srs_app_config.cpp
查看文件 @
23b04e2
...
...
@@ -763,6 +763,18 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
SrsConfDirective
*
old_vhost
=
old_root
->
get
(
"vhost"
,
vhost
);
SrsConfDirective
*
new_vhost
=
root
->
get
(
"vhost"
,
vhost
);
// mode, never supports reload.
// first, for the origin and edge role change is too complex.
// second, the vhosts in origin device group normally are all origin,
// they never change to edge sometimes.
// third, the origin or upnode device can always be restart,
// edge will retry and the users connected to edge are ok.
if
(
get_vhost_is_edge
(
old_vhost
)
!=
get_vhost_is_edge
(
new_vhost
))
{
ret
=
ERROR_RTMP_EDGE_RELOAD
;
srs_error
(
"reload never supports mode changed. ret=%d"
,
ret
);
return
ret
;
}
// DISABLED => ENABLED
if
(
!
get_vhost_enabled
(
old_vhost
)
&&
get_vhost_enabled
(
new_vhost
))
{
srs_trace
(
"vhost %s added, reload it."
,
vhost
.
c_str
());
...
...
@@ -1823,6 +1835,12 @@ int SrsConfig::get_bw_check_limit_kbps(const string &vhost)
bool
SrsConfig
::
get_vhost_is_edge
(
std
::
string
vhost
)
{
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
return
get_vhost_is_edge
(
conf
);
}
bool
SrsConfig
::
get_vhost_is_edge
(
SrsConfDirective
*
vhost
)
{
SrsConfDirective
*
conf
=
vhost
;
if
(
!
conf
)
{
return
false
;
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
23b04e2
...
...
@@ -195,6 +195,7 @@ public:
// vhost edge section
public:
virtual
bool
get_vhost_is_edge
(
std
::
string
vhost
);
virtual
bool
get_vhost_is_edge
(
SrsConfDirective
*
vhost
);
virtual
SrsConfDirective
*
get_vhost_edge_origin
(
std
::
string
vhost
);
// vhost transcode section
public:
...
...
trunk/src/app/srs_app_edge.cpp
查看文件 @
23b04e2
...
...
@@ -252,7 +252,6 @@ int SrsEdgeIngester::connect_server()
// reopen
close_underlayer_socket
();
// TODO: FIXME: support reload
SrsConfDirective
*
conf
=
_srs_config
->
get_vhost_edge_origin
(
_req
->
vhost
);
srs_assert
(
conf
);
...
...
@@ -494,6 +493,7 @@ int SrsEdgeForwarder::proxy(SrsCommonMessage* msg)
return
ret
;
}
// TODO: FIXME: use utility to copy msg to shared ptr msg.
SrsSharedPtrMessage
*
copy
=
new
SrsSharedPtrMessage
();
SrsAutoFree
(
SrsSharedPtrMessage
,
copy
,
false
);
if
((
ret
=
copy
->
initialize
(
msg
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -522,7 +522,6 @@ int SrsEdgeForwarder::connect_server()
// reopen
close_underlayer_socket
();
// TODO: FIXME: support reload
SrsConfDirective
*
conf
=
_srs_config
->
get_vhost_edge_origin
(
_req
->
vhost
);
srs_assert
(
conf
);
...
...
trunk/src/app/srs_app_edge.hpp
查看文件 @
23b04e2
...
...
@@ -152,7 +152,6 @@ private:
* play edge control service.
* downloading edge speed-up.
*/
// TODO: FIXME: support reload
class
SrsPlayEdge
{
private
:
...
...
@@ -183,7 +182,6 @@ public:
* publish edge control service.
* uploading edge speed-up.
*/
// TODO: FIXME: support reload
class
SrsPublishEdge
{
private
:
...
...
trunk/src/app/srs_app_reload.hpp
查看文件 @
23b04e2
...
...
@@ -34,6 +34,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* the handler for config reload.
* when reload callback, the config is updated yet.
*
* features not support reload,
* @see: https://github.com/winlinvip/simple-rtmp-server/wiki/Reload#notsupportedfeatures
*/
class
ISrsReloadHandler
{
...
...
trunk/src/core/srs_core.hpp
查看文件 @
23b04e2
...
...
@@ -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 "7
8
"
#define VERSION_REVISION "7
9
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
trunk/src/kernel/srs_kernel_error.hpp
查看文件 @
23b04e2
...
...
@@ -82,6 +82,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// invalid state for client to publish edge stream.
#define ERROR_RTMP_EDGE_PUBLISH_STATE 321
#define ERROR_RTMP_EDGE_PROXY_PULL 322
#define ERROR_RTMP_EDGE_RELOAD 323
#define ERROR_SYSTEM_STREAM_INIT 400
#define ERROR_SYSTEM_PACKET_INVALID 401
...
...
请
注册
或
登录
后发表评论