Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: chrome/service/cloud_print/cloud_print_url_fetcher.cc

Issue 6966038: Anti-DDoS enhancements: Log to net log, UMA stats, improved policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/service/cloud_print/cloud_print_url_fetcher.cc
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
index 731acd35dff1ab79f38751e8ae3b8b193e25cfd7..13af5f7df19e0abd333df64c8f33216e2dc2efe5 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
@@ -102,12 +102,11 @@ void CloudPrintURLFetcher::OnURLFetchComplete(
}
// Retry the request if needed.
if (action == RETRY_REQUEST) {
- // If the response code is greater than or equal to 500, then the back-off
- // period has been increased at the network level; otherwise, explicitly
- // call ReceivedContentWasMalformed() to count the current request as a
- // failure and increase the back-off period.
- if (response_code < 500)
- request_->ReceivedContentWasMalformed();
+ // Explicitly call ReceivedContentWasMalformed() to ensure the current
+ // request gets counted as a failure for calculation of the back-off
+ // period. If it was already a failure by status code, this call will
+ // be ignored.
+ request_->ReceivedContentWasMalformed();
++num_retries_;
if ((-1 != source->max_retries()) &&
« no previous file with comments | « chrome/common/net/url_fetcher_unittest.cc ('k') | chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698