From: Alex Rousskov Date: Sat, 27 Aug 2011 07:14:24 +0000 (-0600) Subject: Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable X-Git-Tag: SQUID_3_1_15~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec510f8955a69c83288ad233d01a21bece74ebe7;p=thirdparty%2Fsquid.git Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable It is possible that the next hop connection is going through the closing steps when we receive a "noteMoreBodySpaceAvailable" notification from the response body consumer. Do not try to read in this case. --- diff --git a/src/ftp.cc b/src/ftp.cc index d0c25644bc..1b584b9eee 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1295,7 +1295,8 @@ FtpStateData::dataComplete() void FtpStateData::maybeReadVirginBody() { - if (data.fd < 0) + // too late to read + if (data.fd < 0 || fd_table[data.conn->fd].closing()) return; if (data.read_pending) diff --git a/src/http.cc b/src/http.cc index 37f89a9238..4352b5e1b7 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1394,6 +1394,10 @@ HttpStateData::processReplyBody() void HttpStateData::maybeReadVirginBody() { + // too late to read + if (fd >= 0 && fd_table[fd].closing()) + return; + // we may need to grow the buffer if headers do not fit const int minRead = flags.headers_parsed ? 0 :1024; const int read_size = replyBodySpace(*readBuf, minRead);