]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Debugs message about error when headers < minimum size
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 1 Aug 2009 08:36:48 +0000 (20:36 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 1 Aug 2009 08:36:48 +0000 (20:36 +1200)
src/HttpMsg.cc
src/HttpReply.cc
src/HttpRequest.cc

index 8b80f4ffd18b3edc8e363b8de9501f898d2de34b..357e0ffb116d43e4cc5a90edaa967da92ac234c9 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 a25527615af29b937314937cde19a71a8896d733..59104cd6833c89d53e88688b57777388385a83b0 100644 (file)
@@ -446,8 +446,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.size() + 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 4e921bc5bda9228d4568d1e52bb12574348a4efb..0a6e8578b228b3a00722b9489eb45b95fe913185 100644 (file)
@@ -156,6 +156,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;