[Pkg-owncloud-commits] [owncloud-client] 305/333: Propagator: Fix chunking for real

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 d35c0f3ade5168682720d4e5e8ad431c8cdf2d5b
Author: Markus Goetz <markus at woboq.com>
Date:   Sat Apr 5 14:25:41 2014 +0200

    Propagator: Fix chunking for real
    
    The reset() (using seek()) didn't work.
---
 src/mirall/propagator_qnam.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp
index 951e3a7..0de1fb3 100644
--- a/src/mirall/propagator_qnam.cpp
+++ b/src/mirall/propagator_qnam.cpp
@@ -132,6 +132,8 @@ public:
         if (maxlen == 0)
             return 0;
         qint64 ret = _file->read(data, maxlen);
+        if (ret < 0)
+            return -1;
         _read += ret;
         return ret;
     }
@@ -144,12 +146,18 @@ public:
         return _size;
     }
 
+    qint64 bytesAvailable() const
+    {
+        return _size - _read + QIODevice::bytesAvailable();
+    }
+
     // random access, we can seek
     virtual bool isSequential() const{
         return false;
     }
 
     virtual bool seek ( qint64 pos ) {
+        _read = pos;
         return _file->seek(pos + _start);
     }
 };
@@ -316,8 +324,10 @@ void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64)
 
 void PropagateUploadFileQNAM::abort()
 {
-    if (_job &&  _job->reply())
+    if (_job &&  _job->reply()) {
+        qDebug() << Q_FUNC_INFO << this->_item._file;
         _job->reply()->abort();
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

-- 
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