]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Debugs message about error when headers < minimum size
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 27 Jul 2009 15:08:12 +0000 (03:08 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 27 Jul 2009 15:08:12 +0000 (03:08 +1200)
src/HttpMsg.cc
src/HttpReply.cc
src/HttpRequest.cc

index 9e9e7376423c84908a0449a411b0db34f539b17a..17d62742253461f77405869ea620e9a93d51366f 100644 (file)
@@ -154,8 +154,7 @@ 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)) {
-        debugs(58,1, HERE << "first line of HTTP message is invalid");
-        // NP: sanityCheck sets *error
+        // NP: sanityCheck sets *error and sends debug warnings.
         return false;
     }
 
index 13c2de0e0cd657c55655bdaa7b1ba00ec31c425e..16538b95164d709c8ffed8b946c3dcc9c98e0392 100644 (file)
@@ -451,8 +451,10 @@ HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *
     // content is long enough to possibly hold a reply
     // 4 being magic size of a 3-digit number plus space delimiter
     if ( buf->contentSize() < (protoPrefix.psize() + 4) ) {
-        if (hdr_len > 0)
+        if (hdr_len > 0) {
+            debugs(58, 3, HERE << "Too small reply header (" << hdr_len << " bytes)");
             *error = HTTP_INVALID_HEADER;
+        }
         return false;
     }
 
index 8ed42dcde8a888af124c7b079a8d53f7aa97a216..5cb5ebe0d7de59f7a8a1c89945769666dfc8cf8a 100644 (file)
@@ -222,6 +222,7 @@ HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status
     if ( buf->contentSize() < 2 ) {
         // this is ony a real error if the headers apparently complete.
         if (hdr_len > 0) {
+            debugs(58, 3, HERE << "Too large request header (" << hdr_len << " bytes)");
             *error = HTTP_INVALID_HEADER;
         }
         return false;