aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cloud')
-rw-r--r--backends/cloud/downloadrequest.cpp15
-rw-r--r--backends/cloud/downloadrequest.h2
-rw-r--r--backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp6
-rw-r--r--backends/cloud/dropbox/dropboxlistdirectoryrequest.h2
4 files changed, 10 insertions, 15 deletions
diff --git a/backends/cloud/downloadrequest.cpp b/backends/cloud/downloadrequest.cpp
index 6f777b7cb1..756a904c74 100644
--- a/backends/cloud/downloadrequest.cpp
+++ b/backends/cloud/downloadrequest.cpp
@@ -30,23 +30,23 @@ namespace Cloud {
DownloadRequest::DownloadRequest(Storage::BoolCallback callback, Networking::NetworkReadStream *stream, Common::DumpFile *dumpFile):
Request(0), _boolCallback(callback), _remoteFileStream(stream), _localFile(dumpFile) {}
-bool DownloadRequest::handle() {
+void DownloadRequest::handle() {
if (!_remoteFileStream) {
warning("DownloadRequest: no stream to read");
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
- return true;
+ return;
}
if (!_localFile) {
warning("DownloadRequest: no file to write");
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
- return true;
+ return;
}
if (!_localFile->isOpen()) {
warning("DownloadRequest: failed to open file to write");
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
- return true;
+ return;
}
const int kBufSize = 640 * 1024; //640 KB is enough to everyone?..
@@ -58,7 +58,7 @@ bool DownloadRequest::handle() {
warning("DownloadRequest: unable to write all received bytes into output file");
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
if (_boolCallback) (*_boolCallback)(Storage::RequestBoolPair(_id, false));
- return true;
+ return;
}
if (_remoteFileStream->eos()) {
@@ -70,11 +70,8 @@ bool DownloadRequest::handle() {
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
if (_boolCallback) (*_boolCallback)(Storage::RequestBoolPair(_id, _remoteFileStream->httpResponseCode() == 200));
- _localFile->close(); //yes, I know it's closed automatically in ~DumpFile()
- return true;
+ _localFile->close(); //yes, I know it's closed automatically in ~DumpFile()
}
-
- return false;
}
void DownloadRequest::restart() {
diff --git a/backends/cloud/downloadrequest.h b/backends/cloud/downloadrequest.h
index c1564100c2..724cf19d89 100644
--- a/backends/cloud/downloadrequest.h
+++ b/backends/cloud/downloadrequest.h
@@ -39,7 +39,7 @@ public:
DownloadRequest(Storage::BoolCallback callback, Networking::NetworkReadStream *stream, Common::DumpFile *dumpFile);
virtual ~DownloadRequest() { delete _localFile; }
- virtual bool handle();
+ virtual void handle();
virtual void restart();
};
diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp
index be9304081e..31f015a1cd 100644
--- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp
+++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp
@@ -112,13 +112,11 @@ void DropboxListDirectoryRequest::responseCallback(Networking::RequestDataPair p
delete json;
}
-bool DropboxListDirectoryRequest::handle() {
- if (_complete && _filesCallback) {
+void DropboxListDirectoryRequest::handle() {
+ if (_complete) {
ConnMan.getRequestInfo(_id).state = Networking::FINISHED;
if (_filesCallback) (*_filesCallback)(Storage::RequestFileArrayPair(_id, _files));
}
-
- return _complete;
}
void DropboxListDirectoryRequest::restart() {
diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h
index 58f3dc6113..afa544de69 100644
--- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h
+++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h
@@ -47,7 +47,7 @@ public:
DropboxListDirectoryRequest(Common::String token, Common::String path, Storage::FileArrayCallback cb, bool recursive = false);
virtual ~DropboxListDirectoryRequest() { delete _filesCallback; }
- virtual bool handle();
+ virtual void handle();
virtual void restart();
};