--- ./src/HttpMsg.cc
+++ ./src/HttpMsg.cc
@@ -155,6 +155,12 @@
     // 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.
+
+        if (!*error) { // need more data
+            if (eof) // iff we have seen the end, this is an error
+                *error = HTTP_INVALID_HEADER;
+        }
+
         return false;
     }
 

