From: Francesco Chemolli Date: Mon, 14 Nov 2016 16:18:10 +0000 (+0000) Subject: Fix handling of -i and +i; streamline code X-Git-Tag: M-staged-PR71~356^2~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38d17033dd415345295e83806ad89f304faa37ca;p=thirdparty%2Fsquid.git Fix handling of -i and +i; streamline code --- diff --git a/src/acl/RegexData.cc b/src/acl/RegexData.cc index d1dae10e09..91314b48e7 100644 --- a/src/acl/RegexData.cc +++ b/src/acl/RegexData.cc @@ -164,6 +164,7 @@ compileOptimisedREs(std::list &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 &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();