mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #319, refine the error code for RAW APi.
This commit is contained in:
parent
11c409688b
commit
06c7ae62ee
2 changed files with 4 additions and 3 deletions
|
@ -930,7 +930,7 @@ int SrsGoApiRaw::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
std::string scope = r->query_get("scope");
|
std::string scope = r->query_get("scope");
|
||||||
std::string vhost = r->query_get("vhost");
|
std::string vhost = r->query_get("vhost");
|
||||||
if (scope.empty() || (scope != "global" && scope != "vhost")) {
|
if (scope.empty() || (scope != "global" && scope != "vhost")) {
|
||||||
ret = ERROR_SYSTEM_CONFIG_RAW_PARAMS;
|
ret = ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED;
|
||||||
srs_error("raw api query invalid scope=%s. ret=%d", scope.c_str(), ret);
|
srs_error("raw api query invalid scope=%s. ret=%d", scope.c_str(), ret);
|
||||||
return srs_api_response_code(w, r, ret);
|
return srs_api_response_code(w, r, ret);
|
||||||
}
|
}
|
||||||
|
@ -988,7 +988,7 @@ int SrsGoApiRaw::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
std::string scope = r->query_get("scope");
|
std::string scope = r->query_get("scope");
|
||||||
std::string value = r->query_get("value");
|
std::string value = r->query_get("value");
|
||||||
if (scope.empty() || (scope != "global.listen" && scope != "global.pid")) {
|
if (scope.empty() || (scope != "global.listen" && scope != "global.pid")) {
|
||||||
ret = ERROR_SYSTEM_CONFIG_RAW_PARAMS;
|
ret = ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED;
|
||||||
srs_error("raw api query invalid scope=%s. ret=%d", scope.c_str(), ret);
|
srs_error("raw api query invalid scope=%s. ret=%d", scope.c_str(), ret);
|
||||||
return srs_api_response_code(w, r, ret);
|
return srs_api_response_code(w, r, ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define ERROR_SYSTEM_CONFIG_PERSISTENCE 1059
|
#define ERROR_SYSTEM_CONFIG_PERSISTENCE 1059
|
||||||
#define ERROR_SYSTEM_CONFIG_RAW 1060
|
#define ERROR_SYSTEM_CONFIG_RAW 1060
|
||||||
#define ERROR_SYSTEM_CONFIG_RAW_DISABLED 1061
|
#define ERROR_SYSTEM_CONFIG_RAW_DISABLED 1061
|
||||||
#define ERROR_SYSTEM_CONFIG_RAW_PARAMS 1062
|
#define ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED 1062
|
||||||
|
#define ERROR_SYSTEM_CONFIG_RAW_PARAMS 1063
|
||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
// RTMP protocol error.
|
// RTMP protocol error.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue