From: Francesco Chemolli Date: Mon, 12 Jan 2015 15:53:58 +0000 (+0100) Subject: Improve proxy_acl mgr:config output X-Git-Tag: merge-candidate-3-v1~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=702240e4a867d8adf1dcd7e8dcf515f2edbd4f6c;p=thirdparty%2Fsquid.git Improve proxy_acl mgr:config output --- diff --git a/src/acl/Acl.cc b/src/acl/Acl.cc index 75ed78aa08..b24a50871f 100644 --- a/src/acl/Acl.cc +++ b/src/acl/Acl.cc @@ -56,8 +56,10 @@ ACLFlags::parseFlags() } /*Regex code needs to parse -i file*/ - if ( isSet(ACL_F_REGEX_CASE)) + if ( isSet(ACL_F_REGEX_CASE)) { ConfigParser::TokenPutBack("-i"); + makeUnSet('i'); + } } const char * diff --git a/src/acl/Acl.h b/src/acl/Acl.h index f2dac250f0..68f27f9362 100644 --- a/src/acl/Acl.h +++ b/src/acl/Acl.h @@ -40,6 +40,7 @@ public: ACLFlags() : flags_(0) {} bool supported(const ACLFlag f) const; ///< True if the given flag supported void makeSet(const ACLFlag f) { flags_ |= flagToInt(f); } ///< Set the given flag + void makeUnSet(const ACLFlag f) { flags_ &= ~flagToInt(f); } ///< Unset the given flag /// Return true if the given flag is set bool isSet(const ACLFlag f) const { return flags_ & flagToInt(f);} /// Parse optional flags given in the form -[A..Z|a..z] diff --git a/src/acl/UserData.cc b/src/acl/UserData.cc index 8a59acfe28..8d1e1fa24f 100644 --- a/src/acl/UserData.cc +++ b/src/acl/UserData.cc @@ -80,6 +80,11 @@ ACLUserData::dump() const { SBufList sl; + if (flags.required) { + sl.push_back(SBuf("REQUIRED")); + return sl; + } + if (flags.case_insensitive) sl.push_back(SBuf("-i")); @@ -87,9 +92,7 @@ ACLUserData::dump() const * a SBufList this way costs Sum(1,N) iterations. For instance * a 1000-elements list will be filled in 499500 iterations. */ - if (flags.required) { - sl.push_back(SBuf("REQUIRED")); - } else if (names) { + if (names) { UserDataAclDumpVisitor visitor; names->visit(visitor); sl.splice(sl.end(),visitor.contents);