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

Unified Diff: net/base/backoff_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: Fix bug Sanjeev pointed out. 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
« no previous file with comments | « no previous file | net/url_request/url_request_throttler_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/backoff_entry.cc
diff --git a/net/base/backoff_entry.cc b/net/base/backoff_entry.cc
index 44bae52731b2cd998295a8c37d0b22631975aa59..e023ce4976265524db7784f2228e08d02b0d8ff5 100644
--- a/net/base/backoff_entry.cc
+++ b/net/base/backoff_entry.cc
@@ -29,10 +29,13 @@ BackoffEntry::~BackoffEntry() {
void BackoffEntry::InformOfRequest(bool succeeded) {
if (!succeeded) {
- failure_count_++;
+ ++failure_count_;
exponential_backoff_release_time_ = CalculateReleaseTime();
} else {
- failure_count_ = 0;
+ // We slowly decay the number of times delayed instead of resetting it to 0
+ // in order to stay stable if we receive successes interleaved between lots
+ // of failures.
+ failure_count_ = std::max(0, --failure_count_);
sanjeevr 2011/05/04 20:23:09 I think we need to think of a better fix in the lo
Jói 2011/05/04 20:30:14 Added a TODO to revisit this.
// The reason why we are not just cutting the release time to GetTimeNow()
// is on the one hand, it would unset a release time set by
« no previous file with comments | « no previous file | net/url_request/url_request_throttler_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698