Merge remote-tracking branch 'origin/2.1' into 2.2

This commit is contained in:
Olivier Goffart 2016-04-29 08:52:17 +02:00
commit be466b47b7

View file

@ -546,6 +546,14 @@ void PropagateDownloadFileQNAM::slotGetFinished()
return; 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 // 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 transmissionChecksumValidated() // will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated()
// as this is (still) also correct. // as this is (still) also correct.