]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix handling of -i and +i; streamline code
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 14 Nov 2016 16:18:10 +0000 (16:18 +0000)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 14 Nov 2016 16:18:10 +0000 (16:18 +0000)
src/acl/RegexData.cc

index d1dae10e09cb4372a0d6042fa642854c7a2770db..91314b48e702e41e309b8a3b82e58159cff6380c 100644 (file)
@@ -164,6 +164,7 @@ compileOptimisedREs(std::list<RegexPattern> &curlist, const SBufList &sl)
                 accumulatedRE.clear();
                 reSize = 0;
             }
+            continue;
         } else if (configurationLineWord == plus_i) {
             if ((flags & REG_ICASE) == 0) {
                 /* optimisation of  +i ... +i */
@@ -176,14 +177,16 @@ compileOptimisedREs(std::list<RegexPattern> &curlist, const SBufList &sl)
                 accumulatedRE.clear();
                 reSize = 0;
             }
-        } else if (reSize < 1024) {
-            debugs(28, 2, "adding RE '" << configurationLineWord << "'");
-            accumulatedRE.push_back(configurationLineWord);
-            ++numREs;
-            reSize += configurationLineWord.length();
-        } else {
+            continue;
+        }
+
+        debugs(28, 2, "adding RE '" << configurationLineWord << "'");
+        accumulatedRE.push_back(configurationLineWord);
+        ++numREs;
+        reSize += configurationLineWord.length();
+
+        if (reSize > 1024) { // must be < BUFSIZ everything included
             debugs(28, 2, "buffer full, generating new optimised RE..." );
-            accumulatedRE.push_back(configurationLineWord);
             if (!compileRE(newlist, accumulatedRE, flags))
                 return 0;
             accumulatedRE.clear();