]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Merge remote-tracking branch 'origin/2.1' into 2.2
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 29 Apr 2016 06:52:17 +0000 (08:52 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Fri, 29 Apr 2016 06:52:17 +0000 (08:52 +0200)
1  2 
src/libsync/propagatedownload.cpp

index 1a9d2997166137f850b6436d695b29cfd607cda1,0dd920573ada005edc8b0ccfd4881ace9b6298f3..779fe5c36be55bfd66332cb1604266cfe3b9a5a1
@@@ -546,8 -543,16 +546,16 @@@ void PropagateDownloadFileQNAM::slotGet
          return;
      }
  
+     if (_tmpFile.size() == 0 && _item->_size > 0) {
+         FileSystem::remove(_tmpFile.fileName());
+         done(SyncFileItem::NormalError,
+              tr("The downloaded file is empty despite the server announced it should have been %1.")
+                 .arg(Utility::octetsToString(_item->_size)));
+         return;
+     }
+ 
      // Do checksum validation for the download. If there is no checksum header, the validator
 -    // will also emit the validated() signal to continue the flow in slot downloadFinished()
 +    // will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated()
      // as this is (still) also correct.
      ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
      connect(validator, SIGNAL(validated(QByteArray,QByteArray)),