diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 02:37:03 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 02:37:03 +0000 |
commit | 5ab0e300a3ada09918bfdad27da1bd6335b389d7 (patch) | |
tree | a9fc22ed6ce0de45eb9e79513eac0a292fa838d5 /net/url_request/url_request_throttler_entry.cc | |
parent | 780702c2aac603a5ca09c22e34d3f913a375627d (diff) | |
download | chromium_src-5ab0e300a3ada09918bfdad27da1bd6335b389d7.zip chromium_src-5ab0e300a3ada09918bfdad27da1bd6335b389d7.tar.gz chromium_src-5ab0e300a3ada09918bfdad27da1bd6335b389d7.tar.bz2 |
Revert 84196 - Fix logic for handling reports of malformed bodies. To end up counting
one error, we need to count two when the malformed body is reported,
against the one success reported based on the response code from what
must have been a successful HTTP request.
Updated a unit test that previously should have caught this but was
making incorrect assumptions.
BUG=81587
TEST=net_unittests
Review URL: http://codereview.chromium.org/6932013
TBR=joi@chromium.org
Review URL: http://codereview.chromium.org/6932029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_throttler_entry.cc')
-rw-r--r-- | net/url_request/url_request_throttler_entry.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc index b14bcbe..d07f054 100644 --- a/net/url_request/url_request_throttler_entry.cc +++ b/net/url_request/url_request_throttler_entry.cc @@ -196,13 +196,12 @@ void URLRequestThrottlerEntry::UpdateWithResponse( } void URLRequestThrottlerEntry::ReceivedContentWasMalformed() { - // 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); + // 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. GetBackoffEntry()->InformOfRequest(false); } |