fix #79: allow edge vhost to add or remove.

pull/133/head
winlin 11 years ago
parent fe4a23e94a
commit 344a49918a

@ -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());
@ -909,6 +897,19 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
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)) {
srs_trace("vhost %s maybe modified, reload its detail.", vhost.c_str());

Loading…
Cancel
Save