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

fix the http error header.

This commit is contained in:
winlin 2015-08-10 16:41:25 +08:00
parent fbcc07d85a
commit c5bf397295
4 changed files with 52 additions and 7 deletions

View file

@ -109,7 +109,8 @@ int SrsGoApiV1::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
<< SRS_JFIELD_STR("authors", "the primary authors and contributors") << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("requests", "the request itself, for http debug") << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("vhosts", "dumps vhost to json") << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("streams", "dumps streams to json")
<< SRS_JFIELD_STR("streams", "dumps streams to json") << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("errors", "always return an error 100.")
<< SRS_JOBJECT_END
<< SRS_JOBJECT_END;
@ -474,6 +475,26 @@ int SrsGoApiStreams::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
return srs_http_response_json(w, ss.str());
}
SrsGoApiError::SrsGoApiError()
{
}
SrsGoApiError::~SrsGoApiError()
{
}
int SrsGoApiError::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
std::stringstream ss;
ss << SRS_JOBJECT_START
<< SRS_JFIELD_ERROR(100) << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("msg", "SRS demo error.")
<< SRS_JOBJECT_END;
return srs_http_response_json(w, ss.str());
}
SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
: SrsConnection(cm, fd)
{