summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_throttler_entry.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/url_request/url_request_throttler_entry.cc')
-rw-r--r--net/url_request/url_request_throttler_entry.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
index d07f054..b14bcbe 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);
}