[Pkg-owncloud-commits] [owncloud-client] 413/484: Blacklist: Firewall errors are silenced for up to 1h only #4071
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit df6357907106d24997f416e2d8f8d006d563bf44
Author: Christian Kamm <mail at ckamm.de>
Date: Wed Nov 25 10:39:43 2015 +0100
Blacklist: Firewall errors are silenced for up to 1h only #4071
---
src/libsync/syncjournalfilerecord.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libsync/syncjournalfilerecord.cpp b/src/libsync/syncjournalfilerecord.cpp
index c0bbd63..04664ef 100644
--- a/src/libsync/syncjournalfilerecord.cpp
+++ b/src/libsync/syncjournalfilerecord.cpp
@@ -149,13 +149,18 @@ SyncJournalErrorBlacklistRecord SyncJournalErrorBlacklistRecord::update(
entry._lastTryEtag = item._etag;
entry._lastTryTime = Utility::qDateTimeToTime_t(QDateTime::currentDateTime());
// The factor of 5 feels natural: 25s, 2 min, 10 min, ~1h, ~5h, ~24h
- entry._ignoreDuration = qBound(minBlacklistTime, old._ignoreDuration * 5, maxBlacklistTime);
+ entry._ignoreDuration = old._ignoreDuration * 5;
entry._file = item._file;
- if( item._httpErrorCode == 403 || item._httpErrorCode == 413 || item._httpErrorCode == 415 ) {
+ if (item._httpErrorCode == 403 && item._errorString.contains("firewall", Qt::CaseInsensitive)) {
+ qDebug() << "Firewall error: " << item._httpErrorCode << ", blacklisting up to 1h only";
+ entry._ignoreDuration = qMin(entry._ignoreDuration, time_t(60*60));
+
+ } else if( item._httpErrorCode == 403 || item._httpErrorCode == 413 || item._httpErrorCode == 415 ) {
qDebug() << "Fatal Error condition" << item._httpErrorCode << ", maximum blacklist ignore time!";
entry._ignoreDuration = maxBlacklistTime;
}
+ entry._ignoreDuration = qBound(minBlacklistTime, entry._ignoreDuration, maxBlacklistTime);
qDebug() << "blacklisting " << item._file
<< " for " << entry._ignoreDuration
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list