mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine http client, use initialize to set host and port.
This commit is contained in:
parent
2bcb4f811c
commit
1277968d4a
6 changed files with 59 additions and 66 deletions
|
@ -312,8 +312,12 @@ int SrsHttpHooks::do_post(std::string url, std::string req, int& code, string& r
|
|||
}
|
||||
|
||||
SrsHttpClient http;
|
||||
if ((ret = http.initialize(uri.get_host(), uri.get_port())) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsHttpMessage* msg = NULL;
|
||||
if ((ret = http.post(&uri, req, &msg)) != ERROR_SUCCESS) {
|
||||
if ((ret = http.post(uri.get_path(), req, &msg)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
SrsAutoFree(SrsHttpMessage, msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue