]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat Enforcement
authorAutomatic source maintenance <squidadm@squid-cache.org>
Sat, 29 Oct 2011 02:01:54 +0000 (20:01 -0600)
committerAutomatic source maintenance <squidadm@squid-cache.org>
Sat, 29 Oct 2011 02:01:54 +0000 (20:01 -0600)
src/ConfigParser.cc
src/adaptation/Config.cc
src/adaptation/Config.h
src/adaptation/ecap/XactionRep.cc
src/adaptation/icap/ModXact.cc
src/ipc/AtomicWord.cc
src/tests/testConfigParser.cc

index ec602c11ad4869584654b9b368a91b07b8561495..c04aef5cd4f5cd32820e28da724365b530b5246b 100644 (file)
@@ -165,15 +165,15 @@ ConfigParser::QuoteString(String &var)
     bool  needQuote = false;
 
     for (const char *l = s; !needQuote &&  *l != '\0'; l++  )
-            needQuote = !isalnum(*l);
+        needQuote = !isalnum(*l);
 
     if (!needQuote)
         return s;
-    
+
     quotedStr.clean();
     quotedStr.append('"');
     for (; *s != '\0'; s++) {
-        if(*s == '"' || *s == '\\')
+        if (*s == '"' || *s == '\\')
             quotedStr.append('\\');
         quotedStr.append(*s);
     }
index 4810fd37f285f5b427ba864a492f71397abf205b..7ce5813a05844b1633044da5e95750658fb91efe 100644 (file)
@@ -60,7 +60,7 @@ Adaptation::Config::MetaHeader::Value::~Value()
     aclDestroyAclList(&aclList);
 }
 
-Adaptation::Config::MetaHeader::Value::Pointer 
+Adaptation::Config::MetaHeader::Value::Pointer
 Adaptation::Config::MetaHeader::addValue(const String &value)
 {
     Value::Pointer v = new Value(value);
@@ -78,7 +78,7 @@ Adaptation::Config::MetaHeader::match(HttpRequest *request, HttpReply *reply)
         ch.reply = HTTPMSGLOCK(reply);
 
     for (VLI i = values.begin(); i != values.end(); ++i ) {
-        const int ret= ch.fastCheck((*i)->aclList); 
+        const int ret= ch.fastCheck((*i)->aclList);
         debugs(93, 5, HERE << "Check for header name: " << name << ": " << (*i)->value
                <<", HttpRequest: " << request << " HttpReply: " << reply << " matched: " << ret);
         if (ret == ACCESS_ALLOWED)
@@ -87,11 +87,11 @@ Adaptation::Config::MetaHeader::match(HttpRequest *request, HttpReply *reply)
     return NULL;
 }
 
-Adaptation::Config::MetaHeader::Pointer 
+Adaptation::Config::MetaHeader::Pointer
 Adaptation::Config::addMetaHeader(const String &headerName)
 {
     typedef MetaHeaders::iterator AMLI;
-    for(AMLI i = metaHeaders.begin(); i != metaHeaders.end(); ++i) {
+    for (AMLI i = metaHeaders.begin(); i != metaHeaders.end(); ++i) {
         if ((*i)->name == headerName)
             return (*i);
     }
@@ -301,18 +301,18 @@ void
 Adaptation::Config::DumpMetaHeader(StoreEntry *entry, const char *name)
 {
     typedef MetaHeaders::iterator AMLI;
-    for(AMLI m = metaHeaders.begin(); m != metaHeaders.end(); ++m) {
+    for (AMLI m = metaHeaders.begin(); m != metaHeaders.end(); ++m) {
         typedef MetaHeader::Values::iterator VLI;
         for (VLI v =(*m)->values.begin(); v != (*m)->values.end(); ++v ) {
-            storeAppendPrintf(entry, "%s " SQUIDSTRINGPH " %s", 
+            storeAppendPrintf(entry, "%s " SQUIDSTRINGPH " %s",
                               name, SQUIDSTRINGPRINT((*m)->name), ConfigParser::QuoteString((*v)->value));
             dump_acl_list(entry, (*v)->aclList);
             storeAppendPrintf(entry, "\n");
-         }
-    }        
+        }
+    }
 }
 
-void 
+void
 Adaptation::Config::FreeMetaHeader()
 {
     metaHeaders.clean();
index 76d12d6de3066d6c79a28cf3e02c02e407836309..20caf34e7d299c255d5e0d9f3ef0b08837ae0a15 100644 (file)
@@ -49,14 +49,16 @@ public:
 
     /**
      * Used to store meta headers. The meta headers are custom
-     * ICAP request headers or ECAP options used to pass custom 
+     * ICAP request headers or ECAP options used to pass custom
      * transaction-state related meta information to a service.
      */
-    class MetaHeader: public RefCountable {
+    class MetaHeader: public RefCountable
+    {
     public:
         typedef RefCount<MetaHeader> Pointer;
         /// Stores a value for the meta header.
-        class Value: public RefCountable {
+        class Value: public RefCountable
+        {
         public:
             typedef RefCount<Value> Pointer;
             String value; ///< a header value
@@ -67,23 +69,23 @@ public:
         typedef Vector<Value::Pointer> Values;
 
         explicit MetaHeader(const String &aName): name(aName) {}
-        
+
         /**
          * Adds a value to the meta header and returns a  pointer to the
          * related Value object.
          */
         Value::Pointer addValue(const String &value);
 
-       /**
-        * Walks through the  possible values list of the  meta and selects 
-        * the first value which matches the given HttpRequest and HttpReply
-        * or NULL if none matches.
-        */
+        /**
+         * Walks through the  possible values list of the  meta and selects
+         * the first value which matches the given HttpRequest and HttpReply
+         * or NULL if none matches.
+         */
         const char *match(HttpRequest *request, HttpReply *reply);
         String name; ///< The meta header name
         Values values; ///< The possible values list for the meta header
     };
-    typedef Vector<MetaHeader::Pointer> MetaHeaders; 
+    typedef Vector<MetaHeader::Pointer> MetaHeaders;
     static MetaHeaders metaHeaders; ///< The list of configured meta headers
 
     /**
index 0e090f8d001298cb4465b4ee33f68e88d0fffffd..656bda8b0041736bedb7e21755004aefddc20cc7 100644 (file)
@@ -103,7 +103,7 @@ Adaptation::Ecap::XactionRep::visitEachOption(libecap::NamedValueVisitor &visito
         if (const libecap::Area value = masterxSharedValue(name))
             visitor.visit(name, value);
     }
-    
+
     visitEachMetaHeader(visitor);
 
     // TODO: metaServerIp, metaAuthenticatedUser, and metaAuthenticatedGroups
@@ -170,13 +170,13 @@ const libecap::Area
 Adaptation::Ecap::XactionRep::metaValue(const libecap::Name &name) const
 {
     HttpRequest *request = dynamic_cast<HttpRequest*>(theCauseRep ?
-                                 theCauseRep->raw().header : theVirginRep.raw().header);
+                           theCauseRep->raw().header : theVirginRep.raw().header);
     Must(request);
     HttpReply *reply = dynamic_cast<HttpReply*>(theVirginRep.raw().header);
 
     if (name.known()) { // must check to avoid empty names matching unset cfg
         typedef Adaptation::Config::MetaHeaders::iterator ACAMLI;
-        for(ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
+        for (ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
             if (name == (*i)->name.termedBuf()) {
                 if (const char *value = (*i)->match(request, reply))
                     return libecap::Area::FromTempString(value);
@@ -189,16 +189,16 @@ Adaptation::Ecap::XactionRep::metaValue(const libecap::Name &name) const
     return libecap::Area();
 }
 
-void 
+void
 Adaptation::Ecap::XactionRep::visitEachMetaHeader(libecap::NamedValueVisitor &visitor) const
 {
     HttpRequest *request = dynamic_cast<HttpRequest*>(theCauseRep ?
-                                                      theCauseRep->raw().header : theVirginRep.raw().header);
+                           theCauseRep->raw().header : theVirginRep.raw().header);
     Must(request);
     HttpReply *reply = dynamic_cast<HttpReply*>(theVirginRep.raw().header);
-    
+
     typedef Adaptation::Config::MetaHeaders::iterator ACAMLI;
-    for(ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
+    for (ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
         const char *v;
         if (v = (*i)->match(request, reply)) {
             const libecap::Name name((*i)->name.termedBuf());
index c12605ef20abf7de7b6b2f3ad5dd6c9671f2b9fa..d769dd1cd80e692ef932bcf691656346626818ea 100644 (file)
@@ -1416,9 +1416,9 @@ void Adaptation::Icap::ModXact::makeRequestHeaders(MemBuf &buf)
 
     // Adaptation::Config::metaHeaders
     typedef Adaptation::Config::MetaHeaders::iterator ACAMLI;
-    for(ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
+    for (ACAMLI i = Adaptation::Config::metaHeaders.begin(); i != Adaptation::Config::metaHeaders.end(); ++i) {
         HttpRequest *r = virgin.cause ?
-            virgin.cause : dynamic_cast<HttpRequest*>(virgin.header);
+                         virgin.cause : dynamic_cast<HttpRequest*>(virgin.header);
         Must(r);
 
         HttpReply *reply = dynamic_cast<HttpReply*>(virgin.header);
index ec039aa2112d915268fcd432bd83b995b4cc4a28..910b1a7c5f6ae4cdaca29d8b795fa4eb0b3eaf24 100644 (file)
@@ -9,7 +9,8 @@
 #include "ipc/AtomicWord.h"
 #include "protos.h"
 
-bool Ipc::Atomic::Enabled() {
+bool Ipc::Atomic::Enabled()
+{
 #if HAVE_ATOMIC_OPS
     return true;
 #else
index 9bea047c38127fbeb50aa1209a0668dc00bb9c5c..ecf59647932f39dc22bc7703d3ae2ef1973c777b 100644 (file)
@@ -38,7 +38,7 @@ bool testConfigParser::doParseQuotedTest(const char *s, const char *expectInterp
     strtok(cfgline, w_space);
     String unEscaped;
     ConfigParser::ParseQuotedString(&unEscaped);
-    
+
     const bool interpOk = (unEscaped.cmp(expectInterp) == 0);
     if (!interpOk) {
         printf("%25s: %s\n%25s: %s\n%25s: %s\n",
@@ -69,9 +69,9 @@ void testConfigParser::testParseQuoted()
                                      "This is a quoted \"string\" by me"));
 
     // escape sequence test: \\"\"\\"
-    CPPUNIT_ASSERT(doParseQuotedTest("\"escape sequence test: \\\\\\\\\\\"\\\\\\\"\\\\\\\\\\\"\"", 
+    CPPUNIT_ASSERT(doParseQuotedTest("\"escape sequence test: \\\\\\\\\\\"\\\\\\\"\\\\\\\\\\\"\"",
                                      "escape sequence test: \\\\\"\\\"\\\\\""));
-    
+
     // \beginning and end test"
     CPPUNIT_ASSERT(doParseQuotedTest("\"\\\\beginning and end test\\\"\"",
                                      "\\beginning and end test\""));