[Pkg-owncloud-commits] [owncloud-client] 312/333: Fix content-length calculation for sizes multiple of the chunk size.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 3d67d203fe8feb38d10bfee841ad93892a15757f
Author: Klaas Freitag <freitag at owncloud.com>
Date: Mon Apr 7 16:29:06 2014 +0200
Fix content-length calculation for sizes multiple of the chunk size.
---
src/mirall/propagator_qnam.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp
index 0de1fb3..b0e5ccd 100644
--- a/src/mirall/propagator_qnam.cpp
+++ b/src/mirall/propagator_qnam.cpp
@@ -202,8 +202,12 @@ void PropagateUploadFileQNAM::startNextChunk()
path += QString("-chunking-%1-%2-%3").arg(transid).arg(_chunkCount).arg(sendingChunk);
headers["OC-Chunked"] = "1";
int currentChunkSize = chunkSize();
- if (sendingChunk == _chunkCount - 1) // last chunk
+ if (sendingChunk == _chunkCount - 1) { // last chunk
currentChunkSize = (fileSize % chunkSize());
+ if( currentChunkSize == 0 ) { // if the last chunk pretents to be 0, its actually the full chunk size.
+ currentChunkSize = chunkSize();
+ }
+ }
device = new ChunkDevice(_file, chunkSize() * sendingChunk, currentChunkSize);
} else {
device = _file;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list