Blacklist: Treat all 403s the same #4071
authorChristian Kamm <mail@ckamm.de>
Wed, 25 Nov 2015 11:49:57 +0000 (12:49 +0100)
committerChristian Kamm <mail@ckamm.de>
Wed, 25 Nov 2015 11:49:57 +0000 (12:49 +0100)
We can't detect firewall errors due to error message localization.

src/libsync/syncjournalfilerecord.cpp

index 04664efbf28750ee24c4aa882a30736a32fd0f5c..9d1a59c8126a7efed25996a8fad77e9857b506ec 100644 (file)
@@ -152,11 +152,11 @@ SyncJournalErrorBlacklistRecord SyncJournalErrorBlacklistRecord::update(
     entry._ignoreDuration = old._ignoreDuration * 5;
     entry._file = item._file;
 
-    if (item._httpErrorCode == 403 && item._errorString.contains("firewall", Qt::CaseInsensitive)) {
-        qDebug() << "Firewall error: " << item._httpErrorCode << ", blacklisting up to 1h only";
+    if( item._httpErrorCode == 403 ) {
+        qDebug() << "Probably 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 ) {
+    } else if( item._httpErrorCode == 413 || item._httpErrorCode == 415 ) {
         qDebug() << "Fatal Error condition" << item._httpErrorCode << ", maximum blacklist ignore time!";
         entry._ignoreDuration = maxBlacklistTime;
     }