Skip to content

Commit

Permalink
Blacklist: Treat all 403s the same #4071
Browse files Browse the repository at this point in the history
We can't detect firewall errors due to error message localization.
  • Loading branch information
ckamm committed Nov 25, 2015
1 parent 1aa5703 commit 698f47d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libsync/syncjournalfilerecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 698f47d

Please sign in to comment.