From: Automatic source maintenance Date: Sun, 4 Dec 2011 01:33:38 +0000 (-0700) Subject: SourceFormat Enforcement X-Git-Tag: BumpSslServerFirst.take05~12^2~139 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=633b9845aed53872a7ac93d7d4d4bcec5e4f37a9;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/compat/strnrchr.c b/compat/strnrchr.c index 1e5331968a..d5d1753553 100644 --- a/compat/strnrchr.c +++ b/compat/strnrchr.c @@ -34,13 +34,13 @@ const char * strnrchr(const char *s, size_t count, int c) { - const char *rv=NULL; - const char *l=s; - while (count > 0 && *l != 0) { - if (*l==c) - rv=l; - ++l; - --count; - } - return rv; + const char *rv=NULL; + const char *l=s; + while (count > 0 && *l != 0) { + if (*l==c) + rv=l; + ++l; + --count; + } + return rv; } diff --git a/src/HttpHdrSc.cc b/src/HttpHdrSc.cc index 8ad07c49ef..7812b1dfd1 100644 --- a/src/HttpHdrSc.cc +++ b/src/HttpHdrSc.cc @@ -47,9 +47,9 @@ /* a row in the table used for parsing surrogate-control header and statistics */ typedef struct { - const char *name; - http_hdr_sc_type id; - HttpHeaderFieldStat stat; + const char *name; + http_hdr_sc_type id; + HttpHeaderFieldStat stat; } HttpHeaderScFields; /* this table is used for parsing surrogate control header */ @@ -189,39 +189,38 @@ HttpHdrSc::parse(const String * str) sct->noStoreRemote(true); break; - case SC_MAX_AGE: - { - int ma; - if (p && httpHeaderParseInt(p, &ma)) { - sct->maxAge(ma); - } else { - debugs(90, 2, "sc: invalid max-age specs near '" << item << "'"); - sct->clearMaxAge(); - } - - if ((p = strchr (p, '+'))) { - int ms; - ++p; //skip the + char - if (httpHeaderParseInt(p, &ms)) { - sct->maxStale(ms); - } else { - debugs(90, 2, "sc: invalid max-stale specs near '" << item << "'"); - sct->clearMaxStale(); - /* leave the max-age alone */ - } - } - break; - } + case SC_MAX_AGE: { + int ma; + if (p && httpHeaderParseInt(p, &ma)) { + sct->maxAge(ma); + } else { + debugs(90, 2, "sc: invalid max-age specs near '" << item << "'"); + sct->clearMaxAge(); + } + + if ((p = strchr (p, '+'))) { + int ms; + ++p; //skip the + char + if (httpHeaderParseInt(p, &ms)) { + sct->maxStale(ms); + } else { + debugs(90, 2, "sc: invalid max-stale specs near '" << item << "'"); + sct->clearMaxStale(); + /* leave the max-age alone */ + } + } + break; + } case SC_CONTENT: - if ( p && httpHeaderParseQuotedString(p, vlen, &sct->content_)) { - sct->setMask(SC_CONTENT,true); // ugly but saves a copy - } else { + if ( p && httpHeaderParseQuotedString(p, vlen, &sct->content_)) { + sct->setMask(SC_CONTENT,true); // ugly but saves a copy + } else { debugs(90, 2, "sc: invalid content= quoted string near '" << item << "'"); sct->clearContent(); } - break; + break; case SC_OTHER: default: @@ -296,7 +295,7 @@ HttpHdrSc::packInto(Packer * p) const node = targets.head; while (node) { - static_cast(node->data)->packInto(p); + static_cast(node->data)->packInto(p); node = node->next; } } @@ -321,7 +320,7 @@ HttpHdrSc::updateStats(StatHist * hist) const dlink_node *sct = targets.head; while (sct) { - static_cast(sct->data)->updateStats(hist); + static_cast(sct->data)->updateStats(hist); sct = sct->next; } } diff --git a/src/HttpHdrScTarget.h b/src/HttpHdrScTarget.h index 91ce11cbb3..18b1843c2a 100644 --- a/src/HttpHdrScTarget.h +++ b/src/HttpHdrScTarget.h @@ -49,16 +49,16 @@ class HttpHdrScTarget // parsing is done in HttpHdrSc, need to grant them access. friend class HttpHdrSc; public: - static const int MAX_AGE_UNSET=-1; //max-age is unset - static const int MAX_STALE_UNSET=0; //max-stale is unset + static const int MAX_AGE_UNSET=-1; //max-age is unset + static const int MAX_STALE_UNSET=0; //max-stale is unset HttpHdrScTarget(const char *target_): - mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {} + mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {} HttpHdrScTarget(const String &target_): - mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {} + mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {} HttpHdrScTarget(const HttpHdrScTarget &t): - mask(t.mask), max_age(t.max_age), max_stale(t.max_stale), - content_(t.content_), target(t.target) {} + mask(t.mask), max_age(t.max_age), max_stale(t.max_stale), + content_(t.content_), target(t.target) {} bool hasNoStore() const {return isSet(SC_NO_STORE); } void noStore(bool v) { setMask(SC_NO_STORE,v); } @@ -72,13 +72,13 @@ public: bool hasMaxAge() const { return isSet(SC_MAX_AGE); } void maxAge(int v) { - if (v >= 0) { //setting - setMask(SC_MAX_AGE,true); - max_age=v; - } else { - setMask(SC_MAX_AGE,false); - max_age=MAX_AGE_UNSET; - } + if (v >= 0) { //setting + setMask(SC_MAX_AGE,true); + max_age=v; + } else { + setMask(SC_MAX_AGE,false); + max_age=MAX_AGE_UNSET; + } } int maxAge() const { return max_age; } void clearMaxAge() { setMask(SC_MAX_AGE,false); max_age=MAX_AGE_UNSET; } @@ -91,8 +91,8 @@ public: bool hasContent() const { return isSet(SC_CONTENT); } void Content(const String &v) { - setMask(SC_CONTENT,true); - content_=v; + setMask(SC_CONTENT,true); + content_=v; } String content() const { return content_; } void clearContent() { setMask(SC_CONTENT,false); content_.clean(); } diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 0bcc5dfbe2..0c8d78fbbb 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -2433,7 +2433,7 @@ esiEnableProcessing (HttpReply *rep) if (rep->surrogate_control) { HttpHdrScTarget *sctusable = - rep->surrogate_control->getMergedTarget(Config.Accel.surrogate_id); + rep->surrogate_control->getMergedTarget(Config.Accel.surrogate_id); if (!sctusable || !sctusable->hasContent()) /* Nothing generic or targeted at us, or no