Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libsync/common/syncjournaldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ void SyncJournalDb::setUploadInfo(const QString &file, const SyncJournalDb::Uplo
}

if (i._valid) {
Q_ASSERT(i._url.isValid());
const auto query = _queryManager.get(PreparedSqlQueryManager::SetUploadInfoQuery,
QByteArrayLiteral("INSERT OR REPLACE INTO uploadinfo "
"(path, size, modtime, contentChecksum, url) "
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/propagateuploadtus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void PropagateUploadFileTUS::slotChunkFinished()
}
if (!_finished) {
// we just started the upload
if (HttpLogger::requestVerb(*job->reply()) == QByteArrayLiteral("POST")) {
if (HttpLogger::requestVerb(*job->reply()) == QByteArrayLiteral("POST") && !_location.isEmpty()) {
// add the new location
auto info = _item->toUploadInfo();
info._url = _location;
Expand Down
9 changes: 0 additions & 9 deletions src/libsync/propagateuploadv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ void PropagateUploadFileV1::doStartUpload()
abortWithError(SyncFileItem::SoftError, tr("The file »%1« is currently in use").arg(QDir::toNativeSeparators(fileName)));
return;
}

if (!_item->_checksumHeader.isEmpty()) {
// Write the checksum in the database, so if the PUT is sent
// to the server, but the connection drops before we get the etag, we can check the checksum
// in reconcile (issue #5106)
auto pi = _item->toUploadInfo();
propagator()->_journal->setUploadInfo(_item->localName(), pi);
propagator()->_journal->commit(QStringLiteral("Upload info"));
}
propagator()->reportProgress(*_item, 0);

qint64 fileSize = _item->_size;
Expand Down
1 change: 1 addition & 0 deletions test/testsyncjournaldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ private Q_SLOTS:
record._size = 12894789147;
record._modtime = dropMsecs(QDateTime::currentDateTime());
record._valid = true;
record._url = QUrl(QStringLiteral("http://example.com/foo"));
_db.setUploadInfo(QStringLiteral("foo"), record);

Info storedRecord = _db.getUploadInfo(QStringLiteral("foo"));
Expand Down