mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine code, extrat the ISrsHttpMessage.
This commit is contained in:
parent
e2955da78f
commit
ce1bb6c605
13 changed files with 1323 additions and 1202 deletions
|
@ -383,14 +383,14 @@ int SrsIngestSrsInput::parseM3u8(SrsHttpUri* url, double& td, double& duration)
|
|||
return ret;
|
||||
}
|
||||
|
||||
SrsHttpMessage* msg = NULL;
|
||||
ISrsHttpMessage* msg = NULL;
|
||||
if ((ret = client.get(url->get_path(), "", &msg)) != ERROR_SUCCESS) {
|
||||
srs_error("HTTP GET %s failed. ret=%d", url->get_url(), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
srs_assert(msg);
|
||||
SrsAutoFree(SrsHttpMessage, msg);
|
||||
SrsAutoFree(ISrsHttpMessage, msg);
|
||||
|
||||
std::string body;
|
||||
if ((ret = msg->body_read_all(body)) != ERROR_SUCCESS) {
|
||||
|
@ -605,14 +605,14 @@ int SrsIngestSrsInput::SrsTsPiece::fetch(string m3u8)
|
|||
return ret;
|
||||
}
|
||||
|
||||
SrsHttpMessage* msg = NULL;
|
||||
ISrsHttpMessage* msg = NULL;
|
||||
if ((ret = client.get(uri.get_path(), "", &msg)) != ERROR_SUCCESS) {
|
||||
srs_error("HTTP GET %s failed. ret=%d", uri.get_url(), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
srs_assert(msg);
|
||||
SrsAutoFree(SrsHttpMessage, msg);
|
||||
SrsAutoFree(ISrsHttpMessage, msg);
|
||||
|
||||
if ((ret = msg->body_read_all(body)) != ERROR_SUCCESS) {
|
||||
srs_error("read ts failed. ret=%d", ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue