From ad4e1e4cdc57fbf8a034377fdc72aae05562a4d7 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 19 Oct 2016 17:23:42 +0200 Subject: [PATCH] Fixed: Trying to resume after a 206 HTTP status code --- code/ryzom/tools/client/ryzom_installer/src/downloader.cpp | 6 +++++- code/ryzom/tools/client/ryzom_installer/src/operation.h | 1 + .../tools/client/ryzom_installer/src/operationdialog.cpp | 5 +++++ .../tools/client/ryzom_installer/src/operationdialog.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp index eb87a6175..bbc660f8a 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp @@ -388,9 +388,13 @@ void CDownloader::onDownloadFinished() emit downloadDone(); } + else if (status == 206) + { + if (m_listener) m_listener->operationContinue(); + } else { - m_listener->operationFail(tr("HTTP error: %1").arg(status)); + if (m_listener) m_listener->operationFail(tr("HTTP error: %1").arg(status)); } } } diff --git a/code/ryzom/tools/client/ryzom_installer/src/operation.h b/code/ryzom/tools/client/ryzom_installer/src/operation.h index 6d039252a..71627363e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operation.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operation.h @@ -31,6 +31,7 @@ public: virtual void operationProgress(qint64 current, const QString &filename) =0; virtual void operationSuccess(qint64 total) =0; virtual void operationFail(const QString &error) =0; + virtual void operationContinue() = 0; virtual bool operationShouldStop() =0; }; diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 9c7ebabf8..75a0f49aa 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1264,6 +1264,11 @@ void COperationDialog::operationFail(const QString &error) emit fail(error); } +void COperationDialog::operationContinue() +{ + emit done(); +} + bool COperationDialog::operationShouldStop() { QMutexLocker locker(&m_abortingMutex); diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index 50f6d761b..a68912fdd 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -129,6 +129,7 @@ protected: virtual void operationProgress(qint64 current, const QString &filename); virtual void operationSuccess(qint64 total); virtual void operationFail(const QString &error); + virtual void operationContinue(); virtual bool operationShouldStop();