change type from int to size_t
This commit is contained in:
parent
ea45dd3a17
commit
609cc9be21
|
|
@ -44,7 +44,7 @@ void HttpRequester::onResponseCompleted(const SockException &ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpRequester::setRetry(int count, int delay) {
|
void HttpRequester::setRetry(size_t count, size_t delay) {
|
||||||
InfoL << "setRetry max=" << count << ", delay=" << delay;
|
InfoL << "setRetry max=" << count << ", delay=" << delay;
|
||||||
_max_retry = count;
|
_max_retry = count;
|
||||||
_retry_delay = delay;
|
_retry_delay = delay;
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ public:
|
||||||
|
|
||||||
void setOnResult(const HttpRequesterResult &onResult);
|
void setOnResult(const HttpRequesterResult &onResult);
|
||||||
void startRequester(const std::string &url, const HttpRequesterResult &on_result, float timeout_sec = 10);
|
void startRequester(const std::string &url, const HttpRequesterResult &on_result, float timeout_sec = 10);
|
||||||
void setRetry(int count, int delay);
|
void setRetry(size_t count, size_t delay);
|
||||||
int getRetry() const { return _retry; }
|
size_t getRetry() const { return _retry; }
|
||||||
int getRetryDelay() const { return _retry_delay; }
|
size_t getRetryDelay() const { return _retry_delay; }
|
||||||
int getMaxRetry() const { return _max_retry; }
|
size_t getMaxRetry() const { return _max_retry; }
|
||||||
void clear() override;
|
void clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -37,9 +37,9 @@ private:
|
||||||
void onResponseCompleted(const toolkit::SockException &ex) override;
|
void onResponseCompleted(const toolkit::SockException &ex) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _retry = 0;
|
size_t _retry = 0;
|
||||||
int _max_retry = 0;
|
size_t _max_retry = 0;
|
||||||
int _retry_delay = 2000; // ms
|
size_t _retry_delay = 2000; // ms
|
||||||
std::string _res_body;
|
std::string _res_body;
|
||||||
HttpRequesterResult _on_result;
|
HttpRequesterResult _on_result;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue