--------------------- PatchSet 1256 Date: 2005/03/11 23:59:02 Author: nlewycky Branch: prefetching Tag: (none) Log: Remove lingering whitespace damage from when I ran the C indenter on C++ code. Members: src/Debug.h:1.7.6.1->1.7.6.2 src/http.cc:1.43.2.3->1.43.2.4 src/http.h:1.10.2.2->1.10.2.3 src/protos.h:1.48.2.1->1.48.2.2 src/squid.h:1.18.2.1->1.18.2.2 src/url.cc:1.9.6.2->1.9.6.3 Index: squid3/src/Debug.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Debug.h,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -u -r1.7.6.1 -r1.7.6.2 --- squid3/src/Debug.h 12 Jan 2005 21:58:27 -0000 1.7.6.1 +++ squid3/src/Debug.h 11 Mar 2005 23:59:02 -0000 1.7.6.2 @@ -1,6 +1,6 @@ /* - * $Id: Debug.h,v 1.7.6.1 2005/01/12 21:58:27 nlewycky Exp $ + * $Id: Debug.h,v 1.7.6.2 2005/03/11 23:59:02 nlewycky Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -57,15 +57,15 @@ class Debug { - public: +public: static int Levels[MAX_DEBUG_SECTIONS]; static int level; - static std::ostream & getDebugOut(); + static std::ostream &getDebugOut(); static void finishDebug(); static void parseOptions(char const *); - private: - static std::ostringstream * CurrentDebug; +private: + static std::ostringstream *CurrentDebug; }; /* Debug stream */ Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.43.2.3 retrieving revision 1.43.2.4 diff -u -r1.43.2.3 -r1.43.2.4 --- squid3/src/http.cc 6 Mar 2005 23:45:02 -0000 1.43.2.3 +++ squid3/src/http.cc 11 Mar 2005 23:59:10 -0000 1.43.2.4 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.43.2.3 2005/03/06 23:45:02 nlewycky Exp $ + * $Id: http.cc,v 1.43.2.4 2005/03/11 23:59:10 nlewycky Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -78,7 +78,7 @@ static void httpStateFree(int fd, void *data) { - HttpStateData *httpState = static_cast < HttpStateData * >(data); + HttpStateData *httpState = static_cast(data); if (httpState == NULL) return; @@ -111,7 +111,7 @@ static void httpTimeout(int fd, void *data) { - HttpStateData *httpState = static_cast < HttpStateData * >(data); + HttpStateData *httpState = static_cast(data); StoreEntry *entry = httpState->entry; debug(11, 4) ("httpTimeout: FD %d: '%s'\n", fd, storeUrl(entry)); @@ -291,7 +291,7 @@ } void -HttpStateData::processSurrogateControl(HttpReply * reply) +HttpStateData::processSurrogateControl(HttpReply *reply) { #if ESI @@ -550,7 +550,7 @@ * Returns false if the variance cannot be stored */ const char * -httpMakeVaryMark(HttpRequest * request, HttpReply const *reply) +httpMakeVaryMark(HttpRequest * request, HttpReply const * reply) { String vary, hdr; const char *pos = NULL; @@ -563,7 +563,7 @@ vary = httpHeaderGetList(&reply->header, HDR_VARY); while (strListGetItem(&vary, ',', &item, &ilen, &pos)) { - char *name = (char *) xmalloc(ilen + 1); + char *name = (char *)xmalloc(ilen + 1); xstrncpy(name, item, ilen + 1); Tolower(name); @@ -596,7 +596,7 @@ vary = httpHeaderGetList(&reply->header, HDR_X_ACCELERATOR_VARY); while (strListGetItem(&vary, ',', &item, &ilen, &pos)) { - char *name = (char *) xmalloc(ilen + 1); + char *name = (char *)xmalloc(ilen + 1); xstrncpy(name, item, ilen + 1); Tolower(name); strListAdd(&vstr, name, ','); @@ -622,7 +622,7 @@ } void -HttpStateData::failReply(HttpReply * reply, http_status const &status) +HttpStateData::failReply(HttpReply *reply, http_status const & status) { reply->sline.version = HttpVersion(1, 0); reply->sline.status = status; @@ -686,7 +686,7 @@ if (!memBufIsNull(&reply_hdr)) memBufClean(&reply_hdr); - failReply(reply, HTTP_HEADER_TOO_LARGE); + failReply (reply, HTTP_HEADER_TOO_LARGE); reply_hdr_state += 2; @@ -730,7 +730,7 @@ return; } - processSurrogateControl(reply); + processSurrogateControl (reply); /* TODO: we need our own reply * in the httpState, as we probably don't want to replace * the storeEntry with interim headers */ @@ -840,7 +840,7 @@ /* If the reply wants to close the connection, it takes precedence */ if (httpHeaderHasConnDir(&reply->header, "close")) - return COMPLETE_NONPERSISTENT_MSG; + return COMPLETE_NONPERSISTENT_MSG; /* If we didn't send a keep-alive request header, then this * can not be a persistent connection. @@ -902,12 +902,12 @@ * error or connection closed. */ /* XXX this function is too long! */ static void -httpReadReply(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data) +httpReadReply(int fd, char *buf, size_t len, comm_err_t flag, int xerrno,void *data) { - HttpStateData *httpState = static_cast (data); - assert(fd == httpState->fd); + HttpStateData *httpState = static_cast(data); + assert (fd == httpState->fd); PROF_start(HttpStateData_readReply); - httpState->readReply(fd, buf, len, flag, xerrno, data); + httpState->readReply (fd, buf, len, flag, xerrno, data); PROF_stop(HttpStateData_readReply); } @@ -922,7 +922,7 @@ assert(buf == readBuf); /* Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us - */ + */ if (flag == COMM_ERR_CLOSING) { debug(11, 3) ("http socket closing\n"); @@ -942,7 +942,7 @@ #endif - debug(11, 5) ("httpReadReply: FD %d: len %d.\n", fd, (int) len); + debug(11, 5) ("httpReadReply: FD %d: len %d.\n", fd, (int)len); if (flag == COMM_OK && len > 0) { #if DELAY_POOLS @@ -1014,7 +1014,7 @@ */ /* doesn't return */ processReplyHeader(buf, len); - else if (entry->getReply()->sline.status == HTTP_INVALID_HEADER && HttpVersion(0, 9) != entry->getReply()->sline.version) { + else if (entry->getReply()->sline.status == HTTP_INVALID_HEADER && HttpVersion(0,9) != entry->getReply()->sline.version) { ErrorState *err; err = errorCon(ERR_INVALID_REQ, HTTP_BAD_GATEWAY); err->request = requestLink((HttpRequest *) request); @@ -1043,7 +1043,7 @@ http_status s = entry->getReply()->sline.status; HttpVersion httpver = entry->getReply()->sline.version; - if (s == HTTP_INVALID_HEADER && httpver != HttpVersion(0, 9)) { + if (s == HTTP_INVALID_HEADER && httpver != HttpVersion(0,9)) { ErrorState *err; storeEntryReset(entry); err = errorCon(ERR_INVALID_REQ, HTTP_BAD_GATEWAY); @@ -1088,13 +1088,13 @@ if (!flags.headers_pushed) { /* The first block needs us to skip the headers */ /* TODO: make this cleaner. WE should push the headers, NOT the parser */ - size_t end = headersEnd(buf, len); + size_t end = headersEnd (buf, len); /* IF len > end, we need to append data after the * out of band update to the store */ if (len > end) { - tempBuffer.data = (char *) buf + end; + tempBuffer.data = (char *)buf+end; tempBuffer.length = len - end; tempBuffer.offset = currentOffset; currentOffset += tempBuffer.length; @@ -1156,7 +1156,7 @@ fwdUnregister(fd, fwd); fwdComplete(fwd); /* TODO: check that fd is still open here */ - comm_close(fd); + comm_close (fd); fd = -1; httpStateFree(fd, this); return; @@ -1239,15 +1239,15 @@ const HttpHeaderEntry *e; String strFwd; HttpHeaderPos pos = HttpHeaderInitPos; - assert(hdr_out->owner == hoRequest); + assert (hdr_out->owner == hoRequest); /* append our IMS header */ if (request->lastmod > -1 && request->method == METHOD_GET) httpHeaderPutTime(hdr_out, HDR_IF_MODIFIED_SINCE, request->lastmod); - bool we_do_ranges = decideIfWeDoRanges(orig_request); + bool we_do_ranges = decideIfWeDoRanges (orig_request); - String strConnection(httpHeaderGetList(hdr_in, HDR_CONNECTION)); + String strConnection (httpHeaderGetList(hdr_in, HDR_CONNECTION)); while ((e = httpHeaderGetEntry(hdr_in, &pos))) copyOneHeaderFromClientsideRequestToUpstreamRequest(e, strConnection, request, orig_request, hdr_out, we_do_ranges, flags); @@ -1360,7 +1360,7 @@ /* No credentials to forward.. (should have been done above if available) */ } else if (strcmp(orig_request->peer_login, "PROXYPASS") == 0) { /* Special mode, convert proxy authentication to WWW authentication - * (also applies to authentication provided by external acl) + * (also applies to authentication provided by external acl) */ const char *auth = httpHeaderGetStr(hdr_in, HDR_PROXY_AUTHORIZATION); @@ -1444,7 +1444,7 @@ void -copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry * e, String strConnection, HttpRequest * request, HttpRequest * orig_request, HttpHeader * hdr_out, int we_do_ranges, http_state_flags flags) +copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, String strConnection, HttpRequest * request, HttpRequest * orig_request, HttpHeader * hdr_out, int we_do_ranges, http_state_flags flags) { debug(11, 5) ("httpBuildRequestHeader: %s: %s\n", e->name.buf(), e->value.buf()); @@ -1571,7 +1571,7 @@ } int -decideIfWeDoRanges(HttpRequest * orig_request) +decideIfWeDoRanges (HttpRequest * orig_request) { int result = 1; /* decide if we want to do Ranges ourselves @@ -1590,7 +1590,7 @@ result = 0; debug(11, 8) ("decideIfWeDoRanges: range specs: %p, cachable: %d; we_do_ranges: %d\n", - orig_request->range, orig_request->flags.cachable, result); + orig_request->range, orig_request->flags.cachable, result); return result; } @@ -1609,8 +1609,8 @@ HttpVersion httpver(1, 0); memBufPrintf(mb, "%s %s HTTP/%d.%d\r\n", RequestMethodStr[request->method], - request->urlpath.size()? request->urlpath.buf() : "/", - httpver.major, httpver.minor); + request->urlpath.size() ? request->urlpath.buf() : "/", + httpver.major,httpver.minor); /* build and pack headers */ { HttpHeader hdr(hoRequest); @@ -1708,7 +1708,7 @@ httpState->fd = fd; if (fwd->servers) - httpState->_peer = fwd->servers->_peer; /* might be NULL */ + httpState->_peer = fwd->servers->_peer; /* might be NULL */ if (httpState->_peer) { const char *url; @@ -1775,7 +1775,7 @@ static void httpSendRequestEntityDone(int fd, void *data) { - HttpStateData *httpState = static_cast < HttpStateData * >(data); + HttpStateData *httpState = static_cast(data); ACLChecklist ch; debug(11, 5) ("httpSendRequestEntityDone: FD %d\n", fd); ch.request = requestLink(httpState->request); @@ -1845,7 +1845,7 @@ return; } - clientReadBody(httpState->orig_request, (char *) memAllocate(MEM_8K_BUF), 8192, httpRequestBodyHandler, httpState); + clientReadBody(httpState->orig_request, (char *)memAllocate(MEM_8K_BUF), 8192, httpRequestBodyHandler, httpState); } void Index: squid3/src/http.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.h,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.3 diff -u -r1.10.2.2 -r1.10.2.3 --- squid3/src/http.h 26 Jan 2005 19:51:36 -0000 1.10.2.2 +++ squid3/src/http.h 11 Mar 2005 23:59:11 -0000 1.10.2.3 @@ -1,6 +1,6 @@ /* - * $Id: http.h,v 1.10.2.2 2005/01/26 19:51:36 nlewycky Exp $ + * $Id: http.h,v 1.10.2.3 2005/03/11 23:59:11 nlewycky Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -40,7 +40,7 @@ class HttpStateData { - public: +public: static CWCB SendComplete; /* should be private */ void processReplyHeader(const char *buf, int size); @@ -67,15 +67,15 @@ bool surrogateNoStore; void processSurrogateControl(HttpReply *); - private: +private: enum ConnectionStatus { - INCOMPLETE_MSG, - COMPLETE_PERSISTENT_MSG, - COMPLETE_NONPERSISTENT_MSG + INCOMPLETE_MSG, + COMPLETE_PERSISTENT_MSG, + COMPLETE_NONPERSISTENT_MSG }; ConnectionStatus statusIfComplete() const; ConnectionStatus persistentConnStatus() const; - void failReply(HttpReply * reply, http_status const &status); + void failReply (HttpReply *reply, http_status const &status); }; #endif /* SQUID_HTTP_H */ Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.48.2.1 retrieving revision 1.48.2.2 diff -u -r1.48.2.1 -r1.48.2.2 --- squid3/src/protos.h 12 Jan 2005 21:58:30 -0000 1.48.2.1 +++ squid3/src/protos.h 11 Mar 2005 23:59:11 -0000 1.48.2.2 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.48.2.1 2005/01/12 21:58:30 nlewycky Exp $ + * $Id: protos.h,v 1.48.2.2 2005/03/11 23:59:11 nlewycky Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -113,7 +113,7 @@ /* comm.c */ extern void comm_calliocallback(void); -extern bool comm_iocallbackpending(void); /* inline candidate */ +extern bool comm_iocallbackpending(void); /* inline candidate */ extern int comm_listen(int fd); SQUIDCEXTERN int commSetNonBlocking(int fd); @@ -165,7 +165,7 @@ SQUIDCEXTERN void packerAppend(Packer * p, const char *buf, int size); #if STDC_HEADERS SQUIDCEXTERN void -packerPrintf(Packer * p, const char *fmt, ...) PRINTF_FORMAT_ARG2; +packerPrintf(Packer * p, const char *fmt,...) PRINTF_FORMAT_ARG2; #else SQUIDCEXTERN void packerPrintf(); #endif @@ -179,7 +179,7 @@ SQUIDCEXTERN void _db_rotate_log(void); #if STDC_HEADERS -SQUIDCEXTERN void _db_print(const char *, ...) PRINTF_FORMAT_ARG1; +SQUIDCEXTERN void _db_print(const char *,...) PRINTF_FORMAT_ARG1; #else SQUIDCEXTERN void _db_print(); #endif @@ -197,7 +197,7 @@ void FreeObject(void *address) { - O *anObject = static_cast < O * >(address); + O *anObject = static_cast(address); delete anObject; } @@ -230,7 +230,7 @@ SQUIDCEXTERN void idnsPTRLookup(const struct in_addr, IDNSCB *, void *); -extern void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata = true); +extern void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata=true); SQUIDCEXTERN void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int); SQUIDCEXTERN void eventRun(void); SQUIDCEXTERN int eventNextTime(void); @@ -284,15 +284,15 @@ SQUIDCEXTERN int httpCachable(method_t); SQUIDCEXTERN void httpStart(FwdState *); SQUIDCEXTERN mb_size_t httpBuildRequestPrefix(HttpRequest * request, - HttpRequest * orig_request, - StoreEntry * entry, - MemBuf * mb, - http_state_flags); + HttpRequest * orig_request, + StoreEntry * entry, + MemBuf * mb, + http_state_flags); SQUIDCEXTERN void httpAnonInitModule(void); SQUIDCEXTERN int httpAnonHdrAllowed(http_hdr_type hdr_id); SQUIDCEXTERN int httpAnonHdrDenied(http_hdr_type hdr_id); SQUIDCEXTERN void httpBuildRequestHeader(HttpRequest *, HttpRequest *, StoreEntry *, HttpHeader *, http_state_flags); -SQUIDCEXTERN const char *httpMakeVaryMark(HttpRequest * request, HttpReply const *reply); +SQUIDCEXTERN const char *httpMakeVaryMark(HttpRequest * request, HttpReply const * reply); /* ETag */ SQUIDCEXTERN int etagParseInit(ETag * etag, const char *str); @@ -328,8 +328,8 @@ /* Http Surrogate Control Header Field */ extern void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count); -extern void httpHdrScInitModule(void); -extern void httpHdrScCleanModule(void); +extern void httpHdrScInitModule (void); +extern void httpHdrScCleanModule (void); extern HttpHdrSc *httpHdrScCreate(void); extern HttpHdrSc *httpHdrScParseCreate(String const *); extern void httpHdrScDestroy(HttpHdrSc * sc); @@ -338,11 +338,11 @@ extern void httpHdrScJoinWith(HttpHdrSc *, const HttpHdrSc *); extern void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int); extern void httpHdrScUpdateStats(const HttpHdrSc *, StatHist *); -extern HttpHdrScTarget *httpHdrScFindTarget(HttpHdrSc * sc, const char *target); -extern HttpHdrScTarget * httpHdrScGetMergedTarget(HttpHdrSc * sc, const char *ourtarget); +extern HttpHdrScTarget * httpHdrScFindTarget(HttpHdrSc *sc, const char *target); +extern HttpHdrScTarget * httpHdrScGetMergedTarget(HttpHdrSc *sc, const char *ourtarget); /* Http Surrogate control header field 'targets' */ -extern HttpHdrScTarget *httpHdrScTargetCreate(const char *); +extern HttpHdrScTarget * httpHdrScTargetCreate (const char *); extern void httpHdrScTargetDestroy(HttpHdrScTarget *); extern HttpHdrScTarget *httpHdrScTargetDup(const HttpHdrScTarget *); extern void httpHdrScTargetPackInto(const HttpHdrScTarget *, Packer *); @@ -479,8 +479,8 @@ #endif /* USE_WCCP */ SQUIDCEXTERN void ipcache_nbgethostbyname(const char *name, - IPH * handler, - void *handlerData); + IPH * handler, + void *handlerData); SQUIDCEXTERN EVH ipcache_purgelru; SQUIDCEXTERN const ipcache_addrs *ipcache_gethostbyname(const char *, int flags); SQUIDCEXTERN void ipcacheInvalidate(const char *); @@ -774,7 +774,7 @@ SQUIDCEXTERN void fatal(const char *message); #if STDC_HEADERS SQUIDCEXTERN void -fatalf(const char *fmt, ...) PRINTF_FORMAT_ARG1; +fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1; #else SQUIDCEXTERN void fatalf(); #endif @@ -956,7 +956,7 @@ SQUIDCEXTERN void logfileFlush(Logfile * lf); #if STDC_HEADERS SQUIDCEXTERN void -logfilePrintf(Logfile * lf, const char *fmt, ...) PRINTF_FORMAT_ARG2; +logfilePrintf(Logfile * lf, const char *fmt,...) PRINTF_FORMAT_ARG2; #else SQUIDCEXTERN void logfilePrintf(va_alist); #endif @@ -964,7 +964,7 @@ /* * Removal Policies */ -SQUIDCEXTERN RemovalPolicy *createRemovalPolicy(RemovalPolicySettings *settings); +SQUIDCEXTERN RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings); /* * prototypes for system functions missing from system includes Index: squid3/src/squid.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/squid.h,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -u -r1.18.2.1 -r1.18.2.2 --- squid3/src/squid.h 12 Jan 2005 21:58:30 -0000 1.18.2.1 +++ squid3/src/squid.h 11 Mar 2005 23:59:11 -0000 1.18.2.2 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.18.2.1 2005/01/12 21:58:30 nlewycky Exp $ + * $Id: squid.h,v 1.18.2.2 2005/03/11 23:59:11 nlewycky Exp $ * * AUTHOR: Duane Wessels * @@ -383,10 +383,10 @@ template inline A const & -min(A const &lhs, A const &rhs) +min(A const & lhs, A const & rhs) { if (rhs < lhs) - return rhs; + return rhs; return lhs; } @@ -397,10 +397,10 @@ #ifndef max template inline A const & -max(A const &lhs, A const &rhs) +max(A const & lhs, A const & rhs) { if (rhs > lhs) - return rhs; + return rhs; return lhs; } Index: squid3/src/url.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/url.cc,v retrieving revision 1.9.6.2 retrieving revision 1.9.6.3 diff -u -r1.9.6.2 -r1.9.6.3 --- squid3/src/url.cc 23 Feb 2005 15:57:03 -0000 1.9.6.2 +++ squid3/src/url.cc 11 Mar 2005 23:59:12 -0000 1.9.6.3 @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.9.6.2 2005/02/23 15:57:03 nlewycky Exp $ + * $Id: url.cc,v 1.9.6.3 2005/03/11 23:59:12 nlewycky Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -182,10 +182,10 @@ /* more cases? */ } -method_t & operator++(method_t & aMethod) +method_t &operator++ (method_t &aMethod) { - int tmp = (int) aMethod; - aMethod = (method_t) (++tmp); + int tmp = (int)aMethod; + aMethod = (method_t)(++tmp); return aMethod; } @@ -711,10 +711,10 @@ { public: - char *extract(char const *url); + char * extract(char const *url); private: - static char Host[SQUIDHOSTNAMELEN]; + static char Host [SQUIDHOSTNAMELEN]; void init(char const *); void findHostStart(); void trimTrailingChars();