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

@ -102,13 +102,15 @@ int SrsHttpResponseWriter::write(char* data, int size)
{
int ret = ERROR_SUCCESS;
// write the header data in memory.
if (!header_wrote) {
write_header(SRS_CONSTS_HTTP_OK);
if ((ret = send_header(data, size)) != ERROR_SUCCESS) {
srs_error("http: send header failed. ret=%d", ret);
return ret;
}
}
// whatever header is wrote, we should try to send header.
if ((ret = send_header(data, size)) != ERROR_SUCCESS) {
srs_error("http: send header failed. ret=%d", ret);
return ret;
}
// check the bytes send and content length.