mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Fix the OPTIONS read, no infinited chunked mode
This commit is contained in:
parent
a273298e63
commit
9ff8bff601
3 changed files with 76 additions and 0 deletions
|
@ -334,6 +334,12 @@ void SrsHttpMessage::set_header(SrsHttpHeader* header, bool keep_alive)
|
|||
if (!clv.empty()) {
|
||||
_content_length = ::atoll(clv.c_str());
|
||||
}
|
||||
|
||||
// If method is OPTIONS, and no size(content-length or chunked), it's not infinite chunked,
|
||||
// it means there is no body, so we must close the body reader.
|
||||
if (_method == SRS_CONSTS_HTTP_OPTIONS && !chunked && _content_length == -1) {
|
||||
_body->close();
|
||||
}
|
||||
}
|
||||
|
||||
srs_error_t SrsHttpMessage::set_url(string url, bool allow_jsonp)
|
||||
|
@ -921,6 +927,11 @@ SrsHttpResponseReader::~SrsHttpResponseReader()
|
|||
{
|
||||
}
|
||||
|
||||
void SrsHttpResponseReader::close()
|
||||
{
|
||||
is_eof = true;
|
||||
}
|
||||
|
||||
bool SrsHttpResponseReader::eof()
|
||||
{
|
||||
return is_eof;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue