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.
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)
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);