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

Unified Diff: net/url_request/url_request_throttler_entry.cc

Issue 6932013: Fix logic for handling reports of malformed bodies. To end up counting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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: net/url_request/url_request_throttler_entry.cc
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
index d07f054d6b3209344673930b3bf18365aedc46eb..b14bcbe5a83b137408b5f464b5f1383e60e64885 100644
--- a/net/url_request/url_request_throttler_entry.cc
+++ b/net/url_request/url_request_throttler_entry.cc
@@ -196,12 +196,13 @@ void URLRequestThrottlerEntry::UpdateWithResponse(
}
void URLRequestThrottlerEntry::ReceivedContentWasMalformed() {
- // We keep this simple and just count it as a single error.
- //
- // If we wanted to get fancy, we would count two errors here, and decrease
- // the error count only by one when we receive a successful (by status
- // code) response. Instead, we keep things simple by always resetting the
- // error count on success, and therefore counting only a single error here.
+ // A malformed body can only occur when the request to fetch a resource
+ // was successful. Therefore, in such a situation, we will receive one
+ // call to ReceivedContentWasMalformed() and one call to UpdateWithResponse()
+ // with a response categorized as "good". To end up counting one failure,
+ // we need to count two failures here against the one success in
+ // UpdateWithResponse().
+ GetBackoffEntry()->InformOfRequest(false);
GetBackoffEntry()->InformOfRequest(false);
}

Powered by Google App Engine
This is Rietveld 408576698