From: Automatic source maintenance Date: Sun, 20 Nov 2011 02:30:20 +0000 (-0700) Subject: SourceFormat Enforcement X-Git-Tag: BumpSslServerFirst.take01~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e83cdc252b4c81b3a895f17f0f0c1765707e383f;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/Server.cc b/src/Server.cc index f88c84946e..903e3a2134 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -710,7 +710,7 @@ ServerStateData::resumeBodyStorage() if (abortOnBadEntry("store entry aborted while kick producer callback")) return; - if(!adaptedBodySource) + if (!adaptedBodySource) return; handleMoreAdaptedBodyAvailable(); @@ -738,7 +738,7 @@ ServerStateData::handleMoreAdaptedBodyAvailable() const size_t bytesWanted = entry->bytesWanted(Range(0, contentSize)); const size_t spaceAvailable = bytesWanted > 0 ? (bytesWanted + 1) : 0; - if (spaceAvailable < contentSize ) { + if (spaceAvailable < contentSize ) { // No or partial body data consuming typedef NullaryMemFunT Dialer; AsyncCall::Pointer call = asyncCall(93, 5, "ServerStateData::resumeBodyStorage", @@ -752,16 +752,16 @@ ServerStateData::handleMoreAdaptedBodyAvailable() "response body at offset " << adaptedBodySource->consumedSize()); return; } - + if (spaceAvailable < contentSize ) { debugs(11, 5, HERE << "postponing storage of " << (contentSize - spaceAvailable) << " body bytes"); contentSize = spaceAvailable; } - + debugs(11,5, HERE << "storing " << contentSize << " bytes of adapted " << "response body at offset " << adaptedBodySource->consumedSize()); - + BodyPipeCheckout bpc(*adaptedBodySource); const StoreIOBuffer ioBuf(&bpc.buf, currentOffset, contentSize); currentOffset += ioBuf.length; @@ -776,8 +776,8 @@ ServerStateData::handleAdaptedBodyProductionEnded() { if (abortOnBadEntry("entry went bad while waiting for adapted body eof")) return; - - // end consumption if we consumed everything + + // end consumption if we consumed everything if (adaptedBodySource != NULL && adaptedBodySource->exhausted()) endAdaptedBodyConsumption(); // else resumeBodyStorage() will eventually consume the rest diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 96a643fa4a..d4bbe39ce3 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1683,7 +1683,7 @@ ClientHttpRequest::handleAdaptationBlock(const Adaptation::Answer &answer) void ClientHttpRequest::resumeBodyStorage() { - if(!adaptedBodySource) + if (!adaptedBodySource) return; noteMoreBodyDataAvailable(adaptedBodySource); diff --git a/src/format/Config.h b/src/format/Config.h index e4c4882ee5..6385f02bd9 100644 --- a/src/format/Config.h +++ b/src/format/Config.h @@ -30,7 +30,7 @@ public: }; /// The set of custom formats defined in squid.conf -/// +/// class FmtConfig { public: diff --git a/src/format/Format.cc b/src/format/Format.cc index 02eadd2947..4c6f780260 100644 --- a/src/format/Format.cc +++ b/src/format/Format.cc @@ -832,22 +832,22 @@ Format::Format::assemble(MemBuf &mb, AccessLogEntry *al, int logSequenceNumber) snprintf(tmp, sizeof(tmp), "SSL_ERR=%d", al->request->errDetail); out = tmp; } - } else + } else #endif - if (al->request && al->request->errDetail != ERR_DETAIL_NONE) { - if (al->request->errDetail > ERR_DETAIL_START && - al->request->errDetail < ERR_DETAIL_MAX) - out = errorDetailName(al->request->errDetail); - else { - if (al->request->errDetail >= ERR_DETAIL_EXCEPTION_START) - snprintf(tmp, sizeof(tmp), "%s=0x%X", - errorDetailName(al->request->errDetail), (uint32_t) al->request->errDetail); - else - snprintf(tmp, sizeof(tmp), "%s=%d", - errorDetailName(al->request->errDetail), al->request->errDetail); - out = tmp; + if (al->request && al->request->errDetail != ERR_DETAIL_NONE) { + if (al->request->errDetail > ERR_DETAIL_START && + al->request->errDetail < ERR_DETAIL_MAX) + out = errorDetailName(al->request->errDetail); + else { + if (al->request->errDetail >= ERR_DETAIL_EXCEPTION_START) + snprintf(tmp, sizeof(tmp), "%s=0x%X", + errorDetailName(al->request->errDetail), (uint32_t) al->request->errDetail); + else + snprintf(tmp, sizeof(tmp), "%s=%d", + errorDetailName(al->request->errDetail), al->request->errDetail); + out = tmp; + } } - } break; case LFT_SQUID_HIERARCHY: diff --git a/src/format/TokenTableEntry.h b/src/format/TokenTableEntry.h index a1fa4dfa81..f8d876e187 100644 --- a/src/format/TokenTableEntry.h +++ b/src/format/TokenTableEntry.h @@ -19,7 +19,8 @@ namespace Format { /// One entry in a table of format tokens. -class TokenTableEntry { +class TokenTableEntry +{ public: /// the config file ASCII representation for this token /// just the base tag bytes, excluding any option syntax bytes diff --git a/src/forward.cc b/src/forward.cc index cdceafab70..7bd660699f 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -337,7 +337,7 @@ FwdState::fail(ErrorState * errorState) request->detailError(errorState->type, errorState->detail->errorNo()); else #endif - request->detailError(errorState->type, errorState->xerrno); + request->detailError(errorState->type, errorState->xerrno); } /** diff --git a/src/store.cc b/src/store.cc index cd1f684f02..dbdcec5ab1 100644 --- a/src/store.cc +++ b/src/store.cc @@ -417,14 +417,14 @@ StoreEntry::deferProducer(const AsyncCall::Pointer &producer) if (!deferredProducer) deferredProducer = producer; else - debugs(20, 5, HERE << "Deferred producer call is allready set to: " << + debugs(20, 5, HERE << "Deferred producer call is allready set to: " << *deferredProducer << ", requested call: " << *producer); } void StoreEntry::kickProducer() { - if(deferredProducer != NULL){ + if (deferredProducer != NULL) { ScheduleCallHere(deferredProducer); deferredProducer = NULL; }