From: Automatic source maintenance Date: Wed, 3 Aug 2011 00:16:42 +0000 (-0600) Subject: SourceFormat Enforcement X-Git-Tag: take08~55^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96f6f33b443412f7e8075d18c800ee7b560d5134;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index ad87dff450..5e680a5e0f 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -2250,21 +2250,21 @@ parse_peer(peer ** head) p->options.carp_key.set=1; char *nextkey=token+strlen("carp-key="), *key=nextkey; for (; key; key = nextkey) { - nextkey=strchr(key,','); - if (nextkey) ++nextkey; // skip the comma, any - if (0==strncasecmp(key,"scheme",6)) { - p->options.carp_key.scheme=1; - } else if (0==strncasecmp(key,"host",4)) { - p->options.carp_key.host=1; - } else if (0==strncasecmp(key,"port",4)) { - p->options.carp_key.port=1; - } else if (0==strncasecmp(key,"path",4)) { - p->options.carp_key.path=1; - } else if (0==strncasecmp(key,"params",6)) { - p->options.carp_key.params=1; - } else { - fatalf("invalid carp-key '%s'",key); - } + nextkey=strchr(key,','); + if (nextkey) ++nextkey; // skip the comma, any + if (0==strncasecmp(key,"scheme",6)) { + p->options.carp_key.scheme=1; + } else if (0==strncasecmp(key,"host",4)) { + p->options.carp_key.host=1; + } else if (0==strncasecmp(key,"port",4)) { + p->options.carp_key.port=1; + } else if (0==strncasecmp(key,"path",4)) { + p->options.carp_key.path=1; + } else if (0==strncasecmp(key,"params",6)) { + p->options.carp_key.params=1; + } else { + fatalf("invalid carp-key '%s'",key); + } } } else if (!strcasecmp(token, "userhash")) { #if USE_AUTH diff --git a/src/carp.cc b/src/carp.cc index de5ee22b78..1b552f9842 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -181,7 +181,7 @@ carpSelectParent(HttpRequest * request) /* select peer */ for (k = 0; k < n_carp_peers; k++) { - String key; + String key; tp = carp_peers[k]; if (tp->options.carp_key.set) { //this code follows urlCanonical's pattern. @@ -213,7 +213,7 @@ carpSelectParent(HttpRequest * request) if ((pos=request->urlpath.find('?'))!=String::npos) key.append(request->urlpath.substr(pos,request->urlpath.size())); } - } + } // if the url-based key is empty, e.g. because the user is // asking to balance on the path but the request doesn't supply any, // then fall back to canonical URL diff --git a/src/structs.h b/src/structs.h index fe6c7ea01b..3cfda10277 100644 --- a/src/structs.h +++ b/src/structs.h @@ -856,12 +856,12 @@ struct peer { unsigned int allow_miss:1; unsigned int carp:1; struct { - unsigned int set:1; //If false, whole url is to be used. Overrides others - unsigned int scheme:1; - unsigned int host:1; - unsigned int port:1; - unsigned int path:1; - unsigned int params:1; + unsigned int set:1; //If false, whole url is to be used. Overrides others + unsigned int scheme:1; + unsigned int host:1; + unsigned int port:1; + unsigned int path:1; + unsigned int params:1; } carp_key; #if USE_AUTH unsigned int userhash:1;