mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Parallel chunk upload: abort all chunks if one of them errors out
This commit is contained in:
parent
c0de20dda0
commit
d76e3c0488
1 changed files with 10 additions and 1 deletions
|
@ -445,6 +445,13 @@ void PropagateUploadFileQNAM::slotPutFinished()
|
|||
_propagator->_anotherSyncNeeded = true;
|
||||
}
|
||||
|
||||
foreach (auto job, _jobs) {
|
||||
if (job->reply()) {
|
||||
job->reply()->abort();
|
||||
}
|
||||
}
|
||||
|
||||
_finished = true;
|
||||
done(classifyError(err, _item._httpErrorCode), errorString);
|
||||
return;
|
||||
}
|
||||
|
@ -455,6 +462,7 @@ void PropagateUploadFileQNAM::slotPutFinished()
|
|||
_finished = true;
|
||||
QString path = QString::fromUtf8(job->reply()->rawHeader("OC-Finish-Poll"));
|
||||
if (path.isEmpty()) {
|
||||
_finished = true;
|
||||
done(SyncFileItem::NormalError, tr("Poll URL missing"));
|
||||
return;
|
||||
}
|
||||
|
@ -576,7 +584,7 @@ void PropagateUploadFileQNAM::finalize(const SyncFileItem ©)
|
|||
_propagator->_journal->setUploadInfo(_item._file, SyncJournalDb::UploadInfo());
|
||||
_propagator->_journal->commit("upload file start");
|
||||
|
||||
qDebug() << Q_FUNC_INFO << "msec=" <<_duration.elapsed();
|
||||
_finished = true;
|
||||
done(SyncFileItem::Success);
|
||||
}
|
||||
|
||||
|
@ -618,6 +626,7 @@ void PropagateUploadFileQNAM::slotPollFinished()
|
|||
Q_ASSERT(job);
|
||||
|
||||
if (job->_item._status != SyncFileItem::Success) {
|
||||
_finished = true;
|
||||
done(job->_item._status, job->_item._errorString);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue