From 4194f58d0f808bfe19bfd212ffe194e5e2064d6e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 28 Apr 2011 11:48:03 +1200 Subject: [PATCH] Performance: short-circuit reply_body_max_size ACL tests 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/HttpReply.cc b/src/HttpReply.cc index ac088509bf..bfa84dbf22 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -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) -- 2.47.3