diff options
author | ckamm <mail@ckamm.de> | 2017-01-13 16:44:45 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2017-01-13 16:44:45 +0300 |
commit | d76e0ec6d8a730b34e1f522b377f20a9d0e0aa70 (patch) | |
tree | 018b5b13409a5ddfd37d2f72e6f5ebfcf8679465 /test/syncenginetestutils.h | |
parent | 4a83f976e191a0289d50b792c146cb286aabadce (diff) |
Reset stuck chunked uploads eventually #5344 (#5443)
Previously this wasn't happening for errors that were not
NormalErrors because they don't end up in the blacklist.
This revises the resetting logic to be independent of the
error blacklist and make use of UploadInfo::errorCount
instead.
412 errors should reset chunked uploads because they might be
indicative of a checksum error.
Additionally, server bugs might require that additional
errors cause an upload reset. To allow that, a new capability
is added that can be used to advise the client about this.
Diffstat (limited to 'test/syncenginetestutils.h')
-rw-r--r-- | test/syncenginetestutils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h index 88e30216c..665dc2016 100644 --- a/test/syncenginetestutils.h +++ b/test/syncenginetestutils.h @@ -64,6 +64,7 @@ public: virtual void appendByte(const QString &relativePath) = 0; virtual void mkdir(const QString &relativePath) = 0; virtual void rename(const QString &relativePath, const QString &relativeDestinationDirectory) = 0; + virtual void setModTime(const QString &relativePath, const QDateTime &modTime) = 0; }; class DiskFileModifier : public FileModifier @@ -114,6 +115,9 @@ public: QVERIFY(_rootDir.exists(from)); QVERIFY(_rootDir.rename(from, to)); } + void setModTime(const QString &relativePath, const QDateTime &modTime) override { + OCC::FileSystem::setModTime(_rootDir.filePath(relativePath), OCC::Utility::qDateTimeToTime_t(modTime)); + } }; class FileInfo : public FileModifier @@ -201,6 +205,12 @@ public: dir->children.insert(newPathComponents.fileName(), std::move(fi)); } + void setModTime(const QString &relativePath, const QDateTime &modTime) override { + FileInfo *file = findInvalidatingEtags(relativePath); + Q_ASSERT(file); + file->lastModified = modTime; + } + FileInfo *find(const PathComponents &pathComponents, const bool invalidateEtags = false) { if (pathComponents.isEmpty()) { if (invalidateEtags) @@ -641,6 +651,7 @@ public: Q_INVOKABLE void respond() { setAttribute(QNetworkRequest::HttpStatusCodeAttribute, 500); + setError(InternalServerError, "Internal Server Fake Error"); emit metaDataChanged(); emit finished(); } |