]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fixup: Diff minimization
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 15 Jul 2021 18:05:44 +0000 (14:05 -0400)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 16 Jul 2021 17:33:09 +0000 (13:33 -0400)
This version might also be slightly safer in case a call inside the
if-statement changes the truthiness of connWait.

src/adaptation/icap/Xaction.cc

index d0da312625366b6091e0b7cfc03dc84679077782..cc9edffa9087b6ee2960dda0fe4d6e6434d49ccf 100644 (file)
@@ -365,12 +365,13 @@ void Adaptation::Icap::Xaction::handleCommTimedout()
            theService->cfg().methodStr() << " " <<
            theService->cfg().uri << status());
     reuseConnection = false;
-    if (connWait) {
+    const auto whileConnecting = bool(connWait);
+    if (whileConnecting) {
         assert(!haveConnection());
         theService->noteConnectionFailed("timedout");
     } else
         closeConnection(); // so that late Comm callbacks do not disturb bypass
-    throw TexcHere(connWait ?
+    throw TexcHere(whileConnecting ?
                    "timed out while connecting to the ICAP service" :
                    "timed out while talking to the ICAP service");
 }