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

auto open atc for bravo_atc set

This commit is contained in:
winlin 2014-04-29 18:27:00 +08:00
parent 0f498acd7b
commit f02ac02a50
4 changed files with 35 additions and 1 deletions

View file

@ -2656,6 +2656,29 @@ string SrsConfig::get_vhost_http_dir(string vhost)
return conf->arg0();
}
void SrsConfig::set_atc(std::string vhost, bool atc)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return;
}
// create if not exists
if (conf->get("atc") == NULL) {
SrsConfDirective* o = new SrsConfDirective();
o->name = "atc";
conf->directives.push_back(o);
}
// get the atc node
conf = conf->get("atc");
srs_assert(conf);
// refresh
conf->directives.clear();
conf->args.push_back((atc? "true":"false"));
}
bool srs_directive_equals(SrsConfDirective* a, SrsConfDirective* b)
{
// both NULL, equal.