]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Log ICAP_ERR_GONE ICAP transaction outcome when ICAP initiator disappears early.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 17:37:29 +0000 (11:37 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 17:37:29 +0000 (11:37 -0600)
In this case, "early" means "before the end of the ICAP transaction".
Previously, "catch all" ICAP_ERR_UNKNOWN outcome was logged into the
adaptation log in such cases, raising red flags that there is something wrong
with the ICAP service or Squid.

src/adaptation/icap/Elements.cc
src/adaptation/icap/Elements.h
src/adaptation/icap/Xaction.cc

index 17a26130d7400a538ded426bc896147805f769b8..ac82c70ad419137f5150c7bf2a9ac88a505656af 100644 (file)
@@ -8,6 +8,7 @@ namespace Icap
 {
 
 const XactOutcome xoUnknown = "ICAP_ERR_UNKNOWN";
+const XactOutcome xoGone = "ICAP_ERR_GONE";
 const XactOutcome xoRace = "ICAP_ERR_RACE";
 const XactOutcome xoError = "ICAP_ERR_OTHER";
 const XactOutcome xoOpt = "ICAP_OPT";
index ec78a55f6c420175fd6b56961085200d9e24db5f..1e9ad8e18c0328d737ce1cb66e61c2e84ea5dcbf 100644 (file)
@@ -64,6 +64,7 @@ using Adaptation::vectPointStr;
 
 typedef const char *XactOutcome; ///< transaction result for logging
 extern const XactOutcome xoUnknown; ///< initial value: outcome was not set
+extern const XactOutcome xoGone; ///< initiator gone, will not continue
 extern const XactOutcome xoRace; ///< ICAP server closed pconn when we started
 extern const XactOutcome xoError; ///< all kinds of transaction errors
 extern const XactOutcome xoOpt; ///< OPTION transaction
index 883d4c2fb9d24811ead13a04b7a4a73bfc13ade4..58d9f9d77772f90ac0740fceb27185e048d3d0b8 100644 (file)
@@ -476,8 +476,10 @@ void Adaptation::Icap::Xaction::noteInitiatorAborted()
 {
 
     if (theInitiator.set()) {
+        debugs(93,4, HERE << "Initiator gone before ICAP transaction ended");
         clearInitiator();
         detailError(ERR_DETAIL_ICAP_INIT_GONE);
+        setOutcome(xoGone);
         mustStop("initiator aborted");
     }