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

for #319, support HTTP RAW API reload.

This commit is contained in:
winlin 2015-08-27 18:11:50 +08:00
parent f74dc62046
commit d921d59e57
9 changed files with 117 additions and 23 deletions

View file

@ -1116,6 +1116,9 @@ int SrsConfig::reload_http_api(SrsConfDirective* old_root)
{
int ret = ERROR_SUCCESS;
// always support reload without additional code:
// crossdomain, raw_api
// merge config.
std::vector<ISrsReloadHandler*>::iterator it;
@ -1711,7 +1714,7 @@ int SrsConfig::check_config()
SrsConfDirective* conf = get_http_api();
for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "crossdomain") {
if (n != "enabled" && n != "listen" && n != "crossdomain" && n != "raw_api") {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported http_api directive %s, ret=%d", n.c_str(), ret);
return ret;
@ -4293,6 +4296,23 @@ bool SrsConfig::get_http_api_crossdomain()
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
bool SrsConfig::get_http_api_raw_api()
{
static bool DEFAULT = false;
SrsConfDirective* conf = get_http_api();
if (!conf) {
return DEFAULT;
}
conf = conf->get("raw_api");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
bool SrsConfig::get_http_stream_enabled()
{
SrsConfDirective* conf = get_http_stream();