mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
HLS: Rebuild m3u8 to make ts with id, for stat.
This commit is contained in:
parent
bc569d91a0
commit
c1df280211
5 changed files with 161 additions and 76 deletions
|
@ -574,25 +574,7 @@ std::string SrsHttpMessage::parse_rest_id(string pattern)
|
|||
|
||||
srs_error_t SrsHttpMessage::body_read_all(string& body)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
// cache to read.
|
||||
char* buf = new char[SRS_HTTP_READ_CACHE_BYTES];
|
||||
SrsAutoFreeA(char, buf);
|
||||
|
||||
// whatever, read util EOF.
|
||||
while (!_body->eof()) {
|
||||
ssize_t nb_read = 0;
|
||||
if ((err = _body->read(buf, SRS_HTTP_READ_CACHE_BYTES, &nb_read)) != srs_success) {
|
||||
return srs_error_wrap(err, "read body");
|
||||
}
|
||||
|
||||
if (nb_read > 0) {
|
||||
body.append(buf, nb_read);
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
return srs_ioutil_read_all(_body, body);
|
||||
}
|
||||
|
||||
ISrsHttpResponseReader* SrsHttpMessage::body_reader()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue