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

fix the http read chunked encoding bug.

This commit is contained in:
winlin 2015-05-04 18:11:52 +08:00
parent a95fd6d140
commit ea1e015a4e
7 changed files with 104 additions and 34 deletions

View file

@ -1398,11 +1398,8 @@ int SrsHttpConn::do_cycle()
// 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) {
// may should discard the body.
if ((ret = on_got_http_message(req)) != ERROR_SUCCESS) {
return ret;
}
@ -1434,5 +1431,29 @@ int SrsHttpConn::process_request(ISrsHttpResponseWriter* w, SrsHttpMessage* r)
return ret;
}
SrsStaticHttpConn::SrsStaticHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
: SrsHttpConn(cm, fd, m)
{
}
SrsStaticHttpConn::~SrsStaticHttpConn()
{
}
int SrsStaticHttpConn::on_got_http_message(SrsHttpMessage* msg)
{
int ret = ERROR_SUCCESS;
// TODO: FIXME: use the post body.
std::string res;
// get response body.
if ((ret = msg->body_read_all(res)) != ERROR_SUCCESS) {
return ret;
}
return ret;
}
#endif