]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Performance: short-circuit reply_body_max_size ACL tests
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Apr 2011 23:48:03 +0000 (11:48 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Apr 2011 23:48:03 +0000 (11:48 +1200)
In the common default case there are no reply body limits configured.
There is no need to construct ACL checklists for testing. This saves
one allocation and several locking/unlocking cycles per request.

src/HttpReply.cc

index ac088509bfe9fb835f494b4f5ed1f160ba0b5733..bfa84dbf2268ff2a5beb39854d77742323aa0c4f 100644 (file)
@@ -589,6 +589,10 @@ HttpReply::calcMaxBodySize(HttpRequest& request)
         return;
     bodySizeMax = -1;
 
+    // short-circuit ACL testing if there are none configured
+    if (!Config.ReplyBodySize)
+        return;
+
     ACLFilledChecklist ch(NULL, &request, NULL);
 #if FOLLOW_X_FORWARDED_FOR
     if (Config.onoff.acl_uses_indirect_client)