]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Debugs message about error when headers < minimum size
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 29 Jul 2009 09:28:10 +0000 (21:28 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 29 Jul 2009 09:28:10 +0000 (21:28 +1200)
src/HttpMsg.cc
src/HttpReply.cc
src/HttpRequest.cc

index 1e6b04f773b05224e960b9b9fc79a86dd791c7d7..d1b70db83a3863b80cd995dc4a8e558d769341a7 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;