From: Alex Rousskov Date: Sun, 19 May 2013 02:32:10 +0000 (-0600) Subject: Avoid !closing assertions when helpers call comm_read [during reconfigure]. X-Git-Tag: SQUID_3_3_5~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e48d53b23d36b988771806528172bc0e6395a163;p=thirdparty%2Fsquid.git Avoid !closing assertions when helpers call comm_read [during reconfigure]. While helper reading code does check for COMM_ERR_CLOSING, it is not sufficient because helperReturnBuffer() called by the reading code may notice the helper shutdown flag (set earlier by reconfigure) and start closing the connection underneath the reading code feet. --- diff --git a/src/helper.cc b/src/helper.cc index b020a2c142..3f603caf1e 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -36,6 +36,7 @@ #include "comm/Connection.h" #include "comm/Write.h" #include "fd.h" +#include "fde.h" #include "format/Quoting.h" #include "helper.h" #include "Mem.h" @@ -940,7 +941,7 @@ helperHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t len, com helperReturnBuffer(i, srv, hlp, msg, t); } - if (Comm::IsConnOpen(srv->readPipe)) { + if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) { int spaceSize = srv->rbuf_sz - srv->roffset - 1; assert(spaceSize >= 0); @@ -1044,7 +1045,7 @@ helperStatefulHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t helperStatefulReleaseServer(srv); } - if (Comm::IsConnOpen(srv->readPipe)) { + if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) { int spaceSize = srv->rbuf_sz - srv->roffset - 1; assert(spaceSize >= 0);