From ec510f8955a69c83288ad233d01a21bece74ebe7 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Sat, 27 Aug 2011 01:14:24 -0600 Subject: [PATCH] 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. --- src/ftp.cc | 3 ++- src/http.cc | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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); -- 2.47.2