mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #79: allow edge vhost to add or remove.
This commit is contained in:
parent
fe4a23e94a
commit
344a49918a
1 changed files with 13 additions and 12 deletions
|
@ -867,18 +867,6 @@ 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());
|
||||
|
@ -908,6 +896,19 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
|
|||
srs_trace("reload removed vhost %s success.", vhost.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
// 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.
|
||||
// it's ok to add or remove edge/origin vhost.
|
||||
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;
|
||||
}
|
||||
|
||||
// ENABLED => ENABLED (modified)
|
||||
if (get_vhost_enabled(new_vhost) && get_vhost_enabled(old_vhost)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue