]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed erroneous !theEntries.empty() Must() in Adaptation::History.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 12 Sep 2010 22:28:31 +0000 (16:28 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sun, 12 Sep 2010 22:28:31 +0000 (16:28 -0600)
The "we need history" state of the retried transaction may be different from
that of the original one due to reconfigurations, routing responses, etc.

Based on lp 3p1-rock branch, r9622.

src/adaptation/History.cc

index 3ecd4d3780a98b2833256dc5058cb4ca6924e637..3eda70b91a8f2fa4c05ab3a69132f93a16b0c410 100644 (file)
@@ -39,10 +39,10 @@ Adaptation::History::History(): theNextServices(TheNullServices)
 
 int Adaptation::History::recordXactStart(const String &serviceId, const timeval &when, bool retrying)
 {
-    if (retrying) {
-        Must(!theEntries.empty()); // or there would be nothing to retry
+    // the history will be empty on retries if it was enabled after the failure
+    if (retrying && !theEntries.empty())
         theEntries.back().retried = true;
-    }
+
     theEntries.push_back(Adaptation::History::Entry(serviceId, when));
     return theEntries.size() - 1; // record position becomes history ID
 }