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 (!Comm::IsConnOpen(data.conn))
+ // too late to read
+ if (!Comm::IsConnOpen(data.conn) || fd_table[data.conn->fd].closing())
return;
if (data.read_pending)
#endif
#include "err_detail_type.h"
#include "errorpage.h"
+#include "fde.h"
#include "http.h"
#include "HttpControlMsg.h"
#include "HttpHdrContRange.h"
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);