refs #719, avoid infinite loop when info object read succeeds, but has incorrect authorizations

* marker for info reader that it failed
* distinguish between "server cannot be connected" and other errors
This commit is contained in:
Klaus Basan
2016-08-04 00:04:34 +02:00
parent a0c20baf53
commit 3aee6174ac
5 changed files with 50 additions and 14 deletions

View File

@@ -22,6 +22,7 @@
#include <QReadWriteLock>
#include <QString>
#include <QtGlobal>
#include <atomic>
class QNetworkReply;
class QTimer;
@@ -66,6 +67,14 @@ namespace BlackCore
//! \threadsafe
bool isTimerActive() const;
//! Is marked as read failed
//! \threadsafe
bool isMarkedAsFailed() const;
//! Set marker for read failed
//! \threadsafe
void setMarkedAsFailed(bool failed);
//! Set inverval from settings and start
void setIntervalFromSettingsAndStart();
@@ -110,9 +119,10 @@ namespace BlackCore
bool didContentChange(const QString &content, int startPosition = -1);
private:
QDateTime m_updateTimestamp; //!< when file/resource was read
uint m_contentHash = 0; //!< has of the content given
QMetaObject::Connection m_toggleConnection; //!< connection to switch interval from initial to periodic
QDateTime m_updateTimestamp; //!< when file/resource was read
uint m_contentHash = 0; //!< has of the content given
std::atomic<bool> m_markedAsFailed { false }; //!< marker if reading failed
QMetaObject::Connection m_toggleConnection; //!< connection to switch interval from initial to periodic
private slots:
//! switch from initial to periodic