mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #179, support dvr http api. 2.0.123.
This commit is contained in:
parent
691f732204
commit
a3648063d5
5 changed files with 157 additions and 0 deletions
|
@ -516,6 +516,21 @@ int SrsGoApiDvrs::serve_http(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r)
|
|||
} else if (r->is_http_delete()) {
|
||||
int ret = pool->stop(r->query_get("vhost"));
|
||||
|
||||
ss << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_ERROR(ret)
|
||||
<< __SRS_JOBJECT_END;
|
||||
} else if (r->is_http_put()) {
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
std::string body = r->body();
|
||||
SrsJsonAny* json = SrsJsonAny::loads((char*)body.c_str());
|
||||
if (!json) {
|
||||
ret = ERROR_HTTP_JSON_REQUIRED;
|
||||
} else {
|
||||
SrsAutoFree(SrsJsonAny, json);
|
||||
ret = pool->rpc(json);
|
||||
}
|
||||
|
||||
ss << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_ERROR(ret)
|
||||
<< __SRS_JOBJECT_END;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue