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:
parent
fbcc07d85a
commit
c5bf397295
4 changed files with 52 additions and 7 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue