diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-05-11 11:57:07 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2022-05-11 19:57:38 +0300 |
commit | 5a68c06e3e8e228c07890091c45229b374253ead (patch) | |
tree | e039edb2382eb94fe79adeb594c3c6f075af8c66 /src/libsync | |
parent | 99bb1dc703db9ab3de600ad089fe91c5658bb29d (diff) |
Fix timeout detection
Diffstat (limited to 'src/libsync')
-rw-r--r-- | src/libsync/abstractnetworkjob.cpp | 3 | ||||
-rw-r--r-- | src/libsync/abstractnetworkjob.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp index 5ba31c090..80043b846 100644 --- a/src/libsync/abstractnetworkjob.cpp +++ b/src/libsync/abstractnetworkjob.cpp @@ -368,8 +368,9 @@ void AbstractNetworkJob::abort() // calling abort will trigger the execution of finished() // with _reply->error() == QNetworkReply::OperationCanceledError // the api user can then decide whether to discard this job or retry it. - _reply->abort(); + // The order is important, mark as _aborted before we abort the reply which will trigger slotFinished _aborted = true; + _reply->abort(); } else { deleteLater(); } diff --git a/src/libsync/abstractnetworkjob.h b/src/libsync/abstractnetworkjob.h index 0039c1962..411ea1efd 100644 --- a/src/libsync/abstractnetworkjob.h +++ b/src/libsync/abstractnetworkjob.h @@ -81,6 +81,7 @@ public: auto timeoutSec() const { return _timeout; } bool timedOut() const { return _timedout; } + bool aborted() const { return _aborted; } /** Returns an error message, if any. */ QString errorString() const; |