}
}
+/// called on a premature EOF discovered when reading response body
+void
+HttpStateData::markPrematureReplyBodyEofFailure()
+{
+ const auto err = new ErrorState(ERR_READ_ERROR, Http::scBadGateway, fwd->request, fwd->al);
+ static const auto d = MakeNamedErrorDetail("SRV_PREMATURE_EOF");
+ err->detailError(d);
+ fwd->fail(err);
+}
+
/**
* Call this when there is data from the origin server
* which should be sent to either StoreEntry, or to ICAP...
parsedWhole = "http parsed Content-Length body bytes";
else if (clen < 0 && eof)
parsedWhole = "http parsed body ending with expected/required EOF";
+
if (parsedWhole)
markParsedVirginReplyAsWhole(parsedWhole);
+ else if (eof)
+ markPrematureReplyBodyEofFailure();
}
bool
lastChunk = 1;
flags.do_next_read = false;
markParsedVirginReplyAsWhole("http parsed last-chunk");
+ } else if (eof) {
+ markPrematureReplyBodyEofFailure();
}
return true;
}