]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 28 May 2013 14:28:15 +0000 (08:28 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 28 May 2013 14:28:15 +0000 (08:28 -0600)
16 files changed:
src/acl/Acl.cc
src/acl/Acl.h
src/acl/AllOf.cc
src/acl/AllOf.h
src/acl/AnyOf.h
src/acl/Asn.cc
src/acl/BoolOps.cc
src/acl/BoolOps.h
src/acl/Checklist.cc
src/acl/Checklist.h
src/acl/Gadgets.h
src/acl/InnerNode.cc
src/acl/InnerNode.h
src/acl/Tree.cc
src/acl/Tree.h
src/acl/forward.h

index 68e8440fe2d7ea55277f1610f33a0164968a5c98..b5e1c31fd346494f8959d62b7fb44c273a05fb12 100644 (file)
@@ -401,7 +401,6 @@ ACL::~ACL()
     AclMatchedName = NULL; // in case it was pointing to our name
 }
 
-
 ACL::Prototype::Prototype() : prototype (NULL), typeString (NULL) {}
 
 ACL::Prototype::Prototype (ACL const *aPrototype, char const *aType) : prototype (aPrototype), typeString (aType)
index f370563c8f72007bce481a2fcbeb575815229cea..6b82937f44afe2631f5190e952eb94896174f1fc 100644 (file)
@@ -89,10 +89,9 @@ public:
     static const ACLFlag NoFlags[1]; ///< An empty flags list
 };
 
-
 /// A configurable condition. A node in the ACL expression tree.
 /// Can evaluate itself in FilledChecklist context.
-/// Does not change during evaluation. 
+/// Does not change during evaluation.
 /// \ingroup ACLAPI
 class ACL
 {
index 57e67a35270fc413741b25b302b82e6603cad4e8..3e4cc326002de7310e5982ce4b02dafb9aa3ef6e 100644 (file)
@@ -5,7 +5,6 @@
 #include "globals.h"
 #include "MemBuf.h"
 
-
 char const *
 Acl::AllOf::typeString() const
 {
@@ -74,7 +73,7 @@ Acl::AllOf::parse()
     lineCtx.init();
     lineCtx.Printf("(%s line #%d)", name, lineId);
     lineCtx.terminate();
-    
+
     Acl::AndNode *line = new AndNode;
     line->context(lineCtx.content(), config_input_line);
     line->lineParse();
index 7a7f4cebb56fe231e9398156784ad01f5888897e..1358303aa5ea6b12757082d7c8ef9c8dd45504ff 100644 (file)
@@ -3,7 +3,8 @@
 
 #include "acl/InnerNode.h"
 
-namespace Acl {
+namespace Acl
+{
 
 /// Configurable all-of ACL. Each ACL line is a conjuction of ACLs.
 /// Uses AndNode and OrNode to handle squid.conf configuration where multiple
index e1536eeec8c1e2fd7524e8085ba6270df94fcd03..cda920586f213b5aedd966d9e751ae06802a3e71 100644 (file)
@@ -3,7 +3,8 @@
 
 #include "acl/BoolOps.h"
 
-namespace Acl {
+namespace Acl
+{
 
 /// Configurable any-of ACL. Each ACL line is a disjuction of ACLs.
 class AnyOf: public Acl::OrNode
index 50842828119c814cbd8fad5b07c37c5f29afcf42..ea03dd59120c09289323593e85f38e5433304bc3 100644 (file)
@@ -641,9 +641,9 @@ ACLDestinationASNStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist
             return -1;
         // else fall through to noaddr match, hiding the lookup failure (XXX)
     }
-        Ip::Address noaddr;
-        noaddr.SetNoAddr();
-        return data->match(noaddr);
+    Ip::Address noaddr;
+    noaddr.SetNoAddr();
+    return data->match(noaddr);
 }
 
 ACLDestinationASNStrategy *
index 7e48fc04d045d803a57ce56511e03d009c733d16..3b8c89f771338c948700b5594c62e641f2c173ca 100644 (file)
@@ -4,7 +4,6 @@
 #include "Debug.h"
 #include "wordlist.h"
 
-
 /* Acl::NotNode */
 
 Acl::NotNode::NotNode(ACL *acl)
@@ -20,7 +19,7 @@ Acl::NotNode::parse()
 {
     // Not implemented: by the time an upper level parser discovers
     // an '!' operator, there is nothing left for us to parse.
-    assert(false);    
+    assert(false);
 }
 
 int
@@ -61,7 +60,6 @@ Acl::NotNode::dump() const
     return text;
 }
 
-
 /* Acl::AndNode */
 
 char const *
@@ -93,10 +91,9 @@ void
 Acl::AndNode::parse()
 {
     // Not implemented: AndNode cannot be configured directly. See Acl::AllOf.
-    assert(false);    
+    assert(false);
 }
 
-
 /* Acl::OrNode */
 
 char const *
index 316295a0d6ffc091383e735bebf59737c90e50cb..d06c8a94fc1916d5165e7096709542ee527b806d 100644 (file)
@@ -7,7 +7,8 @@
  * They cannot be specified directly in squid.conf because squid.conf ACLs are
  * more complex than (and are implemented using) these operator-like classes.*/
 
-namespace Acl {
+namespace Acl
+{
 
 /// Implements the "not" or "!" operator.
 class NotNode: public InnerNode
@@ -29,7 +30,6 @@ private:
 };
 MEMPROXY_CLASS_INLINE(Acl::NotNode);
 
-
 /// An inner ACL expression tree node representing a boolean conjuction (AND)
 /// operator applied to a list of child tree nodes.
 /// For example, conditions expressed on a single http_access line are ANDed.
@@ -69,7 +69,6 @@ private:
 };
 MEMPROXY_CLASS_INLINE(Acl::OrNode);
 
-
 } // namespace Acl
 
 #endif /* SQUID_ACL_LOGIC_H */
index 279b452a5165fd4130e9121d70c4329883a7dcb3..6774c738e9326e4999201e6996bc761dc82d207b 100644 (file)
@@ -19,31 +19,31 @@ ACLChecklist::prepNonBlocking()
         return false;
     }
 
-        /** \par
-         * If the _acl_access is no longer valid (i.e. its been
-         * freed because of a reconfigure), then bail with ACCESS_DUNNO.
-         */
-
-        if (!cbdataReferenceValid(accessList)) {
-            cbdataReferenceDone(accessList);
-            debugs(28, 4, "ACLChecklist::check: " << this << " accessList is invalid");
-            checkCallback(ACCESS_DUNNO);
-            return false;
-        }
+    /** \par
+     * If the _acl_access is no longer valid (i.e. its been
+     * freed because of a reconfigure), then bail with ACCESS_DUNNO.
+     */
 
-        // If doNonBlocking() was called for a finished() checklist to call
-        // the callbacks, then do not try to match again. XXX: resumeNonBlockingCheck() should check for this instead.
-        if (!finished())
-            return true;
-
-            /** \par
-             * Either the request is allowed, denied, requires authentication.
-             */
-            debugs(28, 3, this << " calling back with " << currentAnswer());
-            cbdataReferenceDone(accessList); /* A */
-            checkCallback(currentAnswer());
-            /* From here on in, this may be invalid */
-            return false;
+    if (!cbdataReferenceValid(accessList)) {
+        cbdataReferenceDone(accessList);
+        debugs(28, 4, "ACLChecklist::check: " << this << " accessList is invalid");
+        checkCallback(ACCESS_DUNNO);
+        return false;
+    }
+
+    // If doNonBlocking() was called for a finished() checklist to call
+    // the callbacks, then do not try to match again. XXX: resumeNonBlockingCheck() should check for this instead.
+    if (!finished())
+        return true;
+
+    /** \par
+     * Either the request is allowed, denied, requires authentication.
+     */
+    debugs(28, 3, this << " calling back with " << currentAnswer());
+    cbdataReferenceDone(accessList); /* A */
+    checkCallback(currentAnswer());
+    /* From here on in, this may be invalid */
+    return false;
 }
 
 void
@@ -139,7 +139,7 @@ ACLChecklist::goAsync(AsyncState *state)
         asyncStage_ = asyncNone; // sanity restored
         return false;
     }
+
     // yes, we must pause until the async callback calls resumeNonBlockingCheck
     asyncStage_ = asyncRunning;
     return true;
@@ -275,7 +275,8 @@ ACLChecklist::resumeNonBlockingCheck(AsyncState *state)
 
 /// performs (or resumes) an ACL tree match and, if successful, sets the action
 void
-ACLChecklist::matchAndFinish() {
+ACLChecklist::matchAndFinish()
+{
     bool result = false;
     if (matchPath.empty()) {
         result = accessList->matches(this);
@@ -284,7 +285,7 @@ ACLChecklist::matchAndFinish() {
         matchPath.pop();
         result = top.parent->resumeMatchingAt(this, top.position);
     }
-    
+
     if (result) // the entire tree matched
         markFinished(accessList->winningAction(), "match");
 }
@@ -358,7 +359,7 @@ ACLChecklist::calcImplicitAnswer()
 {
     // XXX: rename lastSeenAction after review and before commit
     const allow_t lastSeenAction = (accessList && cbdataReferenceValid(accessList)) ?
-        accessList->lastAction() : allow_t(ACCESS_DUNNO);
+                                   accessList->lastAction() : allow_t(ACCESS_DUNNO);
     allow_t implicitRuleAnswer = ACCESS_DUNNO;
     if (lastSeenAction == ACCESS_DENIED) // reverse last seen "deny"
         implicitRuleAnswer = ACCESS_ALLOWED;
index ee56f90ed72029fcab1c334dd84224e4f114e393..c94e4eb826b7a56f2773c2245e70a44f4860a790 100644 (file)
@@ -157,7 +157,7 @@ public:
     /// Otherwise, returns false; the caller is expected to handle the failure.
     bool goAsync(AsyncState *);
 
-    /// Matches (or resumes matching of) a child node while maintaning 
+    /// Matches (or resumes matching of) a child node while maintaning
     /// resumption breadcrumbs if a [grand]child node goes async.
     bool matchChild(const Acl::InnerNode *parent, Acl::Nodes::const_iterator pos, const ACL *child);
 
@@ -201,7 +201,8 @@ public:
 
 private: /* internal methods */
     /// Position of a child node within an ACL tree.
-    class Breadcrumb {
+    class Breadcrumb
+    {
     public:
         Breadcrumb(): parent(NULL) {}
         Breadcrumb(const Acl::InnerNode *aParent, Acl::Nodes::const_iterator aPos): parent(aParent), position(aPos) {}
index 12852a20b10b786859cf47c07bb6c418e31c588e..19a131ced25ca806341da22d11c67c7808fd7543 100644 (file)
@@ -25,7 +25,8 @@ void aclParseAclList(ConfigParser &parser, Acl::Tree **, const char *label);
 /// Template to convert various context lables to strings. \ingroup ACLAPI
 template <class Any>
 inline
-void aclParseAclList(ConfigParser &parser, Acl::Tree **tree, const Any any) {
+void aclParseAclList(ConfigParser &parser, Acl::Tree **tree, const Any any)
+{
     std::ostringstream buf;
     buf << any;
     aclParseAclList(parser, tree, buf.str().c_str());
index 98d62dcfed6c932a2371f184cf7ce5975b6370f4..df091d9d150d4f6293c713f0d7bfc4f11a3d0238 100644 (file)
@@ -11,9 +11,9 @@
 #include "wordlist.h"
 #include <algorithm>
 
-
 // "delete acl" class to use with std::for_each() in InnerNode::~InnerNode()
-class AclDeleter {
+class AclDeleter
+{
 public:
     void operator()(ACL* acl) {
         // Do not delete explicit ACLs; they are maintained by Config.aclList.
@@ -22,7 +22,6 @@ public:
     }
 };
 
-
 Acl::InnerNode::~InnerNode()
 {
     std::for_each(nodes.begin(), nodes.end(), AclDeleter());
index 832ab7355616b05637016dc5f9392a26147ddef6..6f3b14446b85fe6c4fb90ad1266336e4b378b250 100644 (file)
@@ -4,7 +4,8 @@
 #include "acl/Acl.h"
 #include <vector>
 
-namespace Acl {
+namespace Acl
+{
 
 typedef std::vector<ACL*> Nodes; ///< a collection of nodes
 
index 79bd58d80861fb1c6ba974f5e47b1924593cb4fc..3a416aea2700a6741a1cb157ff2cbf65ff0035dc 100644 (file)
@@ -4,7 +4,6 @@
 
 CBDATA_NAMESPACED_CLASS_INIT(Acl, Tree);
 
-
 allow_t
 Acl::Tree::winningAction() const
 {
@@ -61,7 +60,7 @@ Acl::Tree::treeDump(const char *prefix, const ActionToString &convert) const
 
         if (action != actions.end()) {
             const char *act = convert ? convert[action->kind] :
-                (*action == ACCESS_ALLOWED ? "allow" : "deny");
+                              (*action == ACCESS_ALLOWED ? "allow" : "deny");
             wordlistAdd(&text, act ? act : "???");
             ++action;
         }
index c244dafee98f6d12c50206829cafedd6c52117bb..a372839192034912f9ee62880cea65dc462d7356 100644 (file)
@@ -3,7 +3,8 @@
 
 #include "acl/BoolOps.h"
 
-namespace Acl {
+namespace Acl
+{
 
 /// An ORed set of rules at the top of the ACL expression tree, providing two
 /// unique properties: cbdata protection and optional rule actions.
@@ -38,7 +39,6 @@ private:
     CBDATA_CLASS2(Tree);
 };
 
-
 } // namespace Acl
 
 #endif /* SQUID_ACL_TREE_H */
index 4c5f39b216a63c4cd09bf789a5e23f6f8f4814ab..32b28cbd7bc46e979c998574dc674abbc6df87cf 100644 (file)
@@ -10,8 +10,8 @@ class AclAddress;
 class AclDenyInfoList;
 class AclSizeLimit;
 
-
-namespace Acl {
+namespace Acl
+{
 
 class InnerNode;
 class NotNode;