]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable
authorAlex Rousskov <rousskov@squid-cache.org>
Sat, 27 Aug 2011 07:14:24 +0000 (01:14 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 27 Aug 2011 07:14:24 +0000 (01:14 -0600)
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.

src/ftp.cc
src/http.cc

index d0c25644bccafd0c52b79cc720922d948cb64787..1b584b9eee5e14943aba6b554f84083907915531 100644 (file)
@@ -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)
index 37f89a9238d2e7459137ab0ce94973f9893b9166..4352b5e1b7fc8ba180472779f16a7ece0cece1ce 100644 (file)
@@ -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);