]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable
authorAlex Rousskov <rousskov@squid-cache.org>
Sat, 13 Aug 2011 04:15:06 +0000 (22:15 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 13 Aug 2011 04:15:06 +0000 (22:15 -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 ddeffbca63bf51b232414862553e17182655deb3..ee86185d0db93c76204886fd7e0f3104229f007b 100644 (file)
@@ -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)
index 4d9e8d99c582d43911a715a7dfd6f5e3a1470ccf..b740534d5a5493cce1103cfed24b264457cc76e5 100644 (file)
@@ -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);