]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Optimization: Do not create/configure ACLFilledChecklist in vain (#232)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 2 Jul 2018 12:41:26 +0000 (12:41 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 15 Jul 2018 06:28:25 +0000 (18:28 +1200)
While client_db is required for client-side pools to work, it may be
enabled for other reasons, without any client-side pools configured. We
should not create and configure useless ACLFilledChecklist objects
because those operations are already not trivial today and have a
a tendency of becoming more expensive with time.

src/client_side.cc

index 82556c2ec304ef91bf4015620d06c2efeb2431a8..ae3d96af3873417424044f328be53636ff3dd2ce 100644 (file)
@@ -2463,10 +2463,11 @@ ConnStateData::whenClientIpKnown()
 #if USE_DELAY_POOLS
     fd_table[clientConnection->fd].clientInfo = NULL;
 
-    if (Config.onoff.client_db) {
-        /* it was said several times that client write limiter does not work if client_db is disabled */
+    if (!Config.onoff.client_db)
+        return; // client delay pools require client_db
 
-        ClientDelayPools& pools(Config.ClientDelay.pools);
+    ClientDelayPools& pools(Config.ClientDelay.pools);
+    if (pools.size()) {
         ACLFilledChecklist ch(NULL, NULL, NULL);
 
         // TODO: we check early to limit error response bandwith but we