From: Automatic source maintenance Date: Sat, 29 Oct 2011 02:01:54 +0000 (-0600) Subject: SourceFormat Enforcement X-Git-Tag: BumpSslServerFirst.take01~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71ee08359b9bb8426cc9a017b204b10e038e7c29;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/ConfigParser.cc b/src/ConfigParser.cc index ec602c11ad..c04aef5cd4 100644 --- a/src/ConfigParser.cc +++ b/src/ConfigParser.cc @@ -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); } diff --git a/src/adaptation/Config.cc b/src/adaptation/Config.cc index 4810fd37f2..7ce5813a05 100644 --- a/src/adaptation/Config.cc +++ b/src/adaptation/Config.cc @@ -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(); diff --git a/src/adaptation/Config.h b/src/adaptation/Config.h index 76d12d6de3..20caf34e7d 100644 --- a/src/adaptation/Config.h +++ b/src/adaptation/Config.h @@ -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 Pointer; /// Stores a value for the meta header. - class Value: public RefCountable { + class Value: public RefCountable + { public: typedef RefCount Pointer; String value; ///< a header value @@ -67,23 +69,23 @@ public: typedef Vector 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 MetaHeaders; + typedef Vector MetaHeaders; static MetaHeaders metaHeaders; ///< The list of configured meta headers /** diff --git a/src/adaptation/ecap/XactionRep.cc b/src/adaptation/ecap/XactionRep.cc index 0e090f8d00..656bda8b00 100644 --- a/src/adaptation/ecap/XactionRep.cc +++ b/src/adaptation/ecap/XactionRep.cc @@ -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(theCauseRep ? - theCauseRep->raw().header : theVirginRep.raw().header); + theCauseRep->raw().header : theVirginRep.raw().header); Must(request); HttpReply *reply = dynamic_cast(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(theCauseRep ? - theCauseRep->raw().header : theVirginRep.raw().header); + theCauseRep->raw().header : theVirginRep.raw().header); Must(request); HttpReply *reply = dynamic_cast(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()); diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index c12605ef20..d769dd1cd8 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -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(virgin.header); + virgin.cause : dynamic_cast(virgin.header); Must(r); HttpReply *reply = dynamic_cast(virgin.header); diff --git a/src/ipc/AtomicWord.cc b/src/ipc/AtomicWord.cc index ec039aa211..910b1a7c5f 100644 --- a/src/ipc/AtomicWord.cc +++ b/src/ipc/AtomicWord.cc @@ -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 diff --git a/src/tests/testConfigParser.cc b/src/tests/testConfigParser.cc index 9bea047c38..ecf5964793 100644 --- a/src/tests/testConfigParser.cc +++ b/src/tests/testConfigParser.cc @@ -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\""));