]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make broken_posts feature is an HTTP violation.
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 22 Feb 2009 23:09:09 +0000 (12:09 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 22 Feb 2009 23:09:09 +0000 (12:09 +1300)
broken_posts control when enabled is committing an RFC2616 violation.

This patch limits it's use to builds with explicit --enable-http-violations.

TODO: I think its complete, but there may be more code to limit out.

src/cf.data.pre
src/http.cc
src/structs.h

index 702545ccdb7efbbb8dcae5b754cf8b455d71ea31..3aa28b6d17020423f12a4a0a4831b72e009b9733 100644 (file)
@@ -3173,6 +3173,7 @@ DOC_START
 DOC_END
 
 NAME: broken_posts
+IFDEF: HTTP_VIOLATIONS
 TYPE: acl_access
 DEFAULT: none
 LOC: Config.accessList.brokenPosts
index c2f37677236da900ae0ba01f726556aa4597af04..2b307f7ed88e7d515529350ff4398e14d82f2506 100644 (file)
@@ -1971,34 +1971,38 @@ httpStart(FwdState *fwd)
 void
 HttpStateData::doneSendingRequestBody()
 {
-    ACLChecklist ch;
     debugs(11,5, HERE << "doneSendingRequestBody: FD " << fd);
+
+#if HTTP_VIOLATIONS
+    ACLChecklist ch;
     ch.request = HTTPMSGLOCK(request);
 
-    if (Config.accessList.brokenPosts)
+    if (Config.accessList.brokenPosts) {
         ch.accessList = cbdataReference(Config.accessList.brokenPosts);
-
-    /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
-
-    if (!Config.accessList.brokenPosts) {
-        debugs(11, 5, "doneSendingRequestBody: No brokenPosts list");
-        CommIoCbParams io(NULL);
-        io.fd=fd;
-        io.flag=COMM_OK;
-        sendComplete(io);
-    } else if (!ch.fastCheck()) {
-        debugs(11, 5, "doneSendingRequestBody: didn't match brokenPosts");
-        CommIoCbParams io(NULL);
-        io.fd=fd;
-        io.flag=COMM_OK;
-        sendComplete(io);
-    } else {
-        debugs(11, 2, "doneSendingRequestBody: matched brokenPosts");
-        typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
-        Dialer dialer(this, &HttpStateData::sendComplete);
-        AsyncCall::Pointer call= asyncCall(11,5, "HttpStateData::SendComplete", dialer);
-        comm_write(fd, "\r\n", 2, call);
+        /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
+
+        if (!ch.fastCheck()) {
+            debugs(11, 5, "doneSendingRequestBody: didn't match brokenPosts");
+            CommIoCbParams io(NULL);
+            io.fd=fd;
+            io.flag=COMM_OK;
+            sendComplete(io);
+        } else {
+            debugs(11, 2, "doneSendingRequestBody: matched brokenPosts");
+            typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
+            Dialer dialer(this, &HttpStateData::sendComplete);
+            AsyncCall::Pointer call= asyncCall(11,5, "HttpStateData::SendComplete", dialer);
+            comm_write(fd, "\r\n", 2, call);
+        }
+        return;
     }
+    debugs(11, 5, "doneSendingRequestBody: No brokenPosts list");
+#endif /* HTTP_VIOLATIONS */
+
+    CommIoCbParams io(NULL);
+    io.fd=fd;
+    io.flag=COMM_OK;
+    sendComplete(io);
 }
 
 // more origin request body data is available
index d64ba223fb46e0a682491df55b2c7de5e457d2eb..e83b11b74c3971d939be39a3d6c1ccc8434b8c2e 100644 (file)
@@ -462,8 +462,9 @@ struct SquidConfig {
 
         acl_access *snmp;
 #endif
-
+#if HTTP_VIOLATIONS
         acl_access *brokenPosts;
+#endif
 #if USE_IDENT
 
         acl_access *identLookup;