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

for #319, support raw update global.listen

This commit is contained in:
winlin 2015-08-30 23:18:14 +08:00
parent f8d8c3ace4
commit 364460f2ab
5 changed files with 37 additions and 14 deletions

View file

@ -1006,11 +1006,20 @@ int SrsGoApiRaw::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
}
if (invalid) {
ret = ERROR_SYSTEM_CONFIG_RAW_PARAMS;
srs_error("raw api update global.listen invalid eps=%s. ret=%d", value.c_str(), ret);
srs_error("raw api update global.listen=%s failed. ret=%d", value.c_str(), ret);
return srs_api_response_code(w, r, ret);
}
if ((ret = _srs_config->raw_set_listen(eps)) != ERROR_SUCCESS) {
srs_error("raw api update global.listen=%s failed. ret=%d", value.c_str(), ret);
return srs_api_response_code(w, r, ret);
}
}
server->on_signal(SRS_SIGNAL_RELOAD);
server->on_signal(SRS_SIGNAL_PERSISTENCE_CONFIG);
srs_trace("raw api update %s=%s ok.", scope.c_str(), value.c_str());
return srs_api_response(w, r, obj->to_json());
}