From 03865984c1e19cec8b8efdabea9c4c57f5d0084d Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Thu, 15 Jul 2021 14:05:44 -0400 Subject: [PATCH] fixup: Diff minimization 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/adaptation/icap/Xaction.cc b/src/adaptation/icap/Xaction.cc index d0da312625..cc9edffa90 100644 --- a/src/adaptation/icap/Xaction.cc +++ b/src/adaptation/icap/Xaction.cc @@ -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"); } -- 2.47.2