]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Improve proxy_acl mgr:config output
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 12 Jan 2015 15:53:58 +0000 (16:53 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 12 Jan 2015 15:53:58 +0000 (16:53 +0100)
src/acl/Acl.cc
src/acl/Acl.h
src/acl/UserData.cc

index 75ed78aa08a1ddfe95be85089c366e369e348d02..b24a50871f9387571981c6d1770f4fd0fbe226a0 100644 (file)
@@ -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 *
index f2dac250f0d0df3b18376028b8f73bf15d4e2e89..68f27f9362c0f53b8e225af7a54356004b83eb71 100644 (file)
@@ -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]
index 8a59acfe28f20968b31eb1951556d6841a905795..8d1e1fa24fc732dd375ae0021c208b6286b2bc3f 100644 (file)
@@ -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);