From 281832c6d6848e8b0e35fc8695ea4e2c34b68dbd Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 1 Aug 2009 20:17:56 +1200 Subject: [PATCH] Author: Lab10 Bug 2728 regression: assertion failed: http.cc:705: "!eof" Catch the zero size reply edge case again. --- src/HttpMsg.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/HttpMsg.cc b/src/HttpMsg.cc index 17d6274225..7525b070aa 100644 --- a/src/HttpMsg.cc +++ b/src/HttpMsg.cc @@ -154,7 +154,11 @@ bool HttpMsg::parse(MemBuf *buf, bool eof, http_status *error) // sanity check the start line to see if this is in fact an HTTP message if (!sanityCheckStartLine(buf, hdr_len, error)) { - // NP: sanityCheck sets *error and sends debug warnings. + // NP: sanityCheck sets *error and sends debug warnings on syntax errors. + // if we have seen the connection close, this is an error too + if (eof && *error==HTTP_STATUS_NONE) + *error = HTTP_INVALID_HEADER; + return false; } -- 2.47.2