From: Alex Rousskov Date: Sat, 13 Aug 2011 04:15:06 +0000 (-0600) Subject: Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable X-Git-Tag: take08~43^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85bef0a70106c42ef677000bfca88193000a307b;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 ddeffbca63..ee86185d0d 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1215,7 +1215,8 @@ FtpStateData::dataComplete() void FtpStateData::maybeReadVirginBody() { - if (!Comm::IsConnOpen(data.conn)) + // too late to read + if (!Comm::IsConnOpen(data.conn) || fd_table[data.conn->fd].closing()) return; if (data.read_pending) diff --git a/src/http.cc b/src/http.cc index 4d9e8d99c5..b740534d5a 100644 --- a/src/http.cc +++ b/src/http.cc @@ -54,6 +54,7 @@ #endif #include "err_detail_type.h" #include "errorpage.h" +#include "fde.h" #include "http.h" #include "HttpControlMsg.h" #include "HttpHdrContRange.h" @@ -1428,6 +1429,10 @@ HttpStateData::processReplyBody() void HttpStateData::maybeReadVirginBody() { + // too late to read + if (!Comm::IsConnOpen(serverConnection) || fd_table[serverConnection->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);