aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/storage.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-14 07:44:58 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit5cbb3e8705f51337c6455ecb5dc7004abf82bd89 (patch)
tree8ce11f96b7b7fb898e47462e9209d60c3bc1f2ea /backends/cloud/storage.cpp
parentd96cdacb38afd9394ab442e7b5a74cc87a495092 (diff)
downloadscummvm-rg350-5cbb3e8705f51337c6455ecb5dc7004abf82bd89.tar.gz
scummvm-rg350-5cbb3e8705f51337c6455ecb5dc7004abf82bd89.tar.bz2
scummvm-rg350-5cbb3e8705f51337c6455ecb5dc7004abf82bd89.zip
CLOUD: Add Storage::uploadStreamSupported()
Box uses POST multipart/form requests for uploading. Such requests could be sent with libcurl if we either have a file available or a buffer with this file's contents. SavesSyncRequest was using Storage::upload(ReadStream *), which couldn't be implemented in BoxStorage. Thus I've added a method to test whether such upload is supported and, if it's not, SavesSyncRequest uses the other.
Diffstat (limited to 'backends/cloud/storage.cpp')
-rw-r--r--backends/cloud/storage.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp
index 2cf851f3ba..110c97ad9c 100644
--- a/backends/cloud/storage.cpp
+++ b/backends/cloud/storage.cpp
@@ -85,6 +85,10 @@ Networking::Request *Storage::upload(Common::String remotePath, Common::String l
return upload(remotePath, f, callback, errorCallback);
}
+bool Storage::uploadStreamSupported() {
+ return true;
+}
+
Networking::Request *Storage::streamFile(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) {
//most Storages use paths instead of ids, so this should work
return streamFileById(path, callback, errorCallback);