add reachability

This commit is contained in:
Konstantin Käfer
2014-09-29 14:02:42 +02:00
parent 135f68e249
commit 9e44c0eae8
13 changed files with 713 additions and 5 deletions

View File

@@ -123,6 +123,9 @@ public:
void toggleDebug();
bool getDebug() const;
// Call this when the network reachability changed.
void setReachability(bool status);
public:
inline const TransformState &getState() const { return state; }
inline util::ptr<FileSource> getFileSource() const { return fileSource; }

View File

@@ -41,6 +41,10 @@ public:
// This function must call notify().
virtual void cancel() = 0;
// This function is called when the request should be reattempted immediately. This is typically
// reaction to a network status change.
virtual void retryImmediately();
public:
const unsigned long thread_id;
const std::string path;

View File

@@ -36,6 +36,8 @@ public:
void prepare(std::function<void()> fn);
void retryAllPending();
private:
const unsigned long thread_id;

View File

@@ -25,6 +25,7 @@ public:
~HTTPRequest();
void cancel();
void retryImmediately();
private:
void startCacheRequest();