mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the http request reader.
This commit is contained in:
parent
3e394a5f06
commit
025b707330
6 changed files with 289 additions and 133 deletions
|
@ -527,13 +527,20 @@ int SrsHttpApi::do_cycle()
|
|||
return ret;
|
||||
}
|
||||
|
||||
// if SUCCESS, always NOT-NULL and completed message.
|
||||
// if SUCCESS, always NOT-NULL.
|
||||
srs_assert(req);
|
||||
srs_assert(req->is_complete());
|
||||
|
||||
// always free it in this scope.
|
||||
SrsAutoFree(SrsHttpMessage, req);
|
||||
|
||||
// TODO: FIXME: use the post body.
|
||||
std::string res;
|
||||
|
||||
// get response body.
|
||||
if ((ret = req->body_read_all(res)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ok, handle http request.
|
||||
SrsHttpResponseWriter writer(&skt);
|
||||
if ((ret = process_request(&writer, req)) != ERROR_SUCCESS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue