From: Alex Rousskov Date: Sat, 11 May 2013 15:23:59 +0000 (-0600) Subject: Avoid !closing assertions when helpers call comm_read [during reconfigure]. X-Git-Tag: SQUID_3_4_0_1~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0bb5517e65f5b5e84c3e8d32fb28caad295f202;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 bd238197ee..55c4720867 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" @@ -957,7 +958,7 @@ helperHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t len, com srv->rbuf[srv->roffset] = '\0'; } - 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); @@ -1078,7 +1079,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);