mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
Http client 302错误码支持
This commit is contained in:
parent
339fdf0de4
commit
ed78f152ee
@ -39,6 +39,7 @@ HttpClient::~HttpClient() {
|
||||
|
||||
void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
|
||||
_aliveTicker.resetTime();
|
||||
_url = strUrl;
|
||||
auto protocol = FindField(strUrl.data(), NULL, "://");
|
||||
uint16_t defaultPort;
|
||||
bool isHttps;
|
||||
@ -155,6 +156,7 @@ int64_t HttpClient::onRecvHeader(const char *data, uint64_t len) {
|
||||
return 0;
|
||||
}
|
||||
HttpClient::clear();
|
||||
setMethod("GET");
|
||||
HttpClient::sendRequest(newUrl,_fTimeOutSec);
|
||||
return 0;
|
||||
}
|
||||
|
@ -254,6 +254,10 @@ public:
|
||||
const Parser& response() const{
|
||||
return _parser;
|
||||
}
|
||||
|
||||
const string &getUrl() const{
|
||||
return _url;
|
||||
}
|
||||
protected:
|
||||
/**
|
||||
* 收到http回复头
|
||||
@ -307,6 +311,7 @@ private:
|
||||
protected:
|
||||
bool _isHttps;
|
||||
private:
|
||||
string _url;
|
||||
HttpHeader _header;
|
||||
HttpBody::Ptr _body;
|
||||
string _method;
|
||||
|
Loading…
Reference in New Issue
Block a user