1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

check 'vhost' validity in 'http raw dvr api' (#2435)

This commit is contained in:
Xiaoniu 2021-06-28 07:51:57 +08:00 committed by winlin
parent bfae75077e
commit 31679c46d4
2 changed files with 14 additions and 1 deletions

View file

@ -3171,6 +3171,8 @@ srs_error_t SrsConfig::raw_disable_vhost(string vhost, bool& applied)
applied = false;
SrsConfDirective* conf = root->get("vhost", vhost);
srs_assert(conf);
conf->get_or_create("enabled")->set_arg0("off");
if ((err = do_reload_vhost_removed(vhost)) != srs_success) {
@ -3189,6 +3191,8 @@ srs_error_t SrsConfig::raw_enable_vhost(string vhost, bool& applied)
applied = false;
SrsConfDirective* conf = root->get("vhost", vhost);
srs_assert(conf);
conf->get_or_create("enabled")->set_arg0("on");
if ((err = do_reload_vhost_added(vhost)) != srs_success) {
@ -3207,6 +3211,8 @@ srs_error_t SrsConfig::raw_enable_dvr(string vhost, string stream, bool& applied
applied = false;
SrsConfDirective* conf = root->get("vhost", vhost);
srs_assert(conf);
conf = conf->get_or_create("dvr")->get_or_create("dvr_apply");
if (conf->args.size() == 1 && (conf->arg0() == "all" || conf->arg0() == "none")) {
@ -3233,6 +3239,8 @@ srs_error_t SrsConfig::raw_disable_dvr(string vhost, string stream, bool& applie
applied = false;
SrsConfDirective* conf = root->get("vhost", vhost);
srs_assert(conf);
conf = conf->get_or_create("dvr")->get_or_create("dvr_apply");
std::vector<string>::iterator it;