--------------------- PatchSet 3827 Date: 2006/10/03 22:14:53 Author: rousskov Branch: squid3-icap Tag: (none) Log: - Allow for multiple calls to mustStop() because we might signal a stop and then, for example, hit an exception that signals the stop again. The original stop reason is stored, but additional reasons are reported. - When handling an exception, do not check whether the transaction is done() before stopping the transaction. The done() check does not work well in the exception handler because the transaction may be in an inconsistent or intermediate state (e.g., already done connecting but not writing yet). Old code would fail to prevent connection reuse or to stop the transaction because done() would be true in the handler after comm_connect failure. It is now OK to call mustStop() multiple times so the original check justification is no longer valid. Members: src/ICAP/ICAPXaction.cc:1.1.2.4->1.1.2.5 Index: squid3/src/ICAP/ICAPXaction.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPXaction.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/ICAP/ICAPXaction.cc 3 Oct 2006 19:53:10 -0000 1.1.2.4 +++ squid3/src/ICAP/ICAPXaction.cc 3 Oct 2006 22:14:53 -0000 1.1.2.5 @@ -344,10 +344,13 @@ void ICAPXaction::mustStop(const char *aReason) { Must(inCall); // otherwise nobody will call doStop() - Must(!stopReason); Must(aReason); - stopReason = aReason; - debugs(93, 5, typeName << " will stop, reason: " << stopReason); + if (!stopReason) { + stopReason = aReason; + debugs(93, 5, typeName << " will stop, reason: " << stopReason); + } else { + debugs(93, 5, typeName << " will stop, another reason: " << aReason); + } } // internal cleanup @@ -392,10 +395,8 @@ debugs(93, 4, typeName << "::" << inCall << " caught an exception: " << e.message << ' ' << status()); - if (!done()) { - reuseConnection = false; // be conservative - mustStop("exception"); - } + reuseConnection = false; // be conservative + mustStop("exception"); } void ICAPXaction::callEnd()