--------------------- PatchSet 4682 Date: 2007/06/01 20:55:59 Author: rousskov Branch: squid3-icap Tag: (none) Log: Ignore comm_write notifications if the newly added ICAPXaction::ignoreLastWrite member is set. This allows kids to more safely work around comm inability to cancel a pending write request. Removed ICAPXaction members that were copied to AsyncJob some time ago. Polished debugging. Members: src/ICAP/ICAPXaction.cc:1.1.2.20->1.1.2.21 src/ICAP/ICAPXaction.h:1.1.2.9->1.1.2.10 Index: squid3/src/ICAP/ICAPXaction.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPXaction.cc,v retrieving revision 1.1.2.20 retrieving revision 1.1.2.21 diff -u -r1.1.2.20 -r1.1.2.21 --- squid3/src/ICAP/ICAPXaction.cc 23 May 2007 14:32:31 -0000 1.1.2.20 +++ squid3/src/ICAP/ICAPXaction.cc 1 Jun 2007 20:55:59 -0000 1.1.2.21 @@ -68,6 +68,7 @@ commEof(false), reuseConnection(true), isRetriable(true), + ignoreLastWrite(false), connector(NULL), reader(NULL), writer(NULL), closer(NULL) { debugs(93,3, typeName << " constructed, this=" << this << @@ -81,7 +82,7 @@ } void ICAPXaction::disableRetries() { - debugs(93,5, typeName << (isRetriable ? "becomes" : "remains") << + debugs(93,5, typeName << (isRetriable ? " becomes" : " remains") << " final" << status()); isRetriable = false; } @@ -225,12 +226,16 @@ Must(writer); writer = NULL; - - Must(commStatus == COMM_OK); - - updateTimeout(); - - handleCommWrote(size); + + if (ignoreLastWrite) { + // a hack due to comm inability to cancel a pending write + ignoreLastWrite = false; + debugs(93, 7, HERE << "ignoring last write; status: " << commStatus); + } else { + Must(commStatus == COMM_OK); + updateTimeout(); + handleCommWrote(size); + } ICAPXaction_Exit(); } Index: squid3/src/ICAP/ICAPXaction.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPXaction.h,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -u -r1.1.2.9 -r1.1.2.10 --- squid3/src/ICAP/ICAPXaction.h 25 Apr 2007 21:23:51 -0000 1.1.2.9 +++ squid3/src/ICAP/ICAPXaction.h 1 Jun 2007 20:55:59 -0000 1.1.2.10 @@ -1,6 +1,6 @@ /* - * $Id: ICAPXaction.h,v 1.1.2.9 2007/04/25 21:23:51 rousskov Exp $ + * $Id: ICAPXaction.h,v 1.1.2.10 2007/06/01 20:55:59 rousskov Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -132,6 +132,7 @@ bool commEof; bool reuseConnection; bool isRetriable; + bool ignoreLastWrite; const char *stopReason; @@ -141,13 +142,9 @@ IOCB *writer; PF *closer; - const char *typeName; // the type of the final class (child), for debugging - private: static int TheLastId; - const char *inCall; // name of the asynchronous call being executed, if any - static void reusedConnection(void *data); //CBDATA_CLASS2(ICAPXaction);