Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2021-10-08 16:47:13 +0300
committerHannah von Reth <vonreth@kde.org>2021-10-25 15:07:23 +0300
commit2c6ba1da5ea3923db92e1c858ad2d3406696b3b1 (patch)
tree376ffdfeba25213c32a4a6e98f86f9546d6a1c8f /src
parente50b65875ee896c5f3d3bdc474f5ba2408ed1475 (diff)
Read the Header OC-Perm for the remote permissions on TUS.
With this the client will save a subsequent PROPFIND request after a TUS upload. It requires that the server sends the OC-Perm header. oCIS will do that.
Diffstat (limited to 'src')
-rw-r--r--src/libsync/propagateuploadtus.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libsync/propagateuploadtus.cpp b/src/libsync/propagateuploadtus.cpp
index aad0de582..f57c35d37 100644
--- a/src/libsync/propagateuploadtus.cpp
+++ b/src/libsync/propagateuploadtus.cpp
@@ -229,10 +229,18 @@ void PropagateUploadFileTUS::slotChunkFinished()
startNextChunk();
return;
}
+
+ // ==== handling when the upload is finished:
const QByteArray etag = getEtagFromReply(job->reply());
+ const QByteArray remPerms = job->reply()->rawHeader("OC-Perm");
+ if (!remPerms.isEmpty()) {
+ _item->_remotePerm = RemotePermissions::fromServerString(QString::fromUtf8(remPerms));
+ }
- _finished = !etag.isEmpty();
+ _finished = !(etag.isEmpty() || _item->_remotePerm.isNull());
if (!_finished) {
+ // Either the ETag or the remote Permissions were not in the headers of the reply.
+ // Start a PROPFIND to fetch these data from the server.
auto check = new PropfindJob(propagator()->account(), propagator()->fullRemotePath(_item->_file));
_jobs.append(check);
check->setProperties({ "http://owncloud.org/ns:fileid", "http://owncloud.org/ns:permissions", "getetag" });