From: wessels <> Date: Tue, 17 Mar 1998 11:00:11 +0000 (+0000) Subject: removed unused code; updated comments; formatting X-Git-Tag: SQUID_3_0_PRE1~3813 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=901e234d18a9557119a0c0f2a807b5d04cc3e957;p=thirdparty%2Fsquid.git removed unused code; updated comments; formatting --- diff --git a/src/cf.data.pre b/src/cf.data.pre index ebd58282d1..4b94cb5ed5 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -273,39 +273,6 @@ EXAMPLE: neighbor_type_domain cache.foo.org sibling .au .de DOC_END -NAME: single_parent_bypass -COMMENT: on|off -TYPE: onoff -DEFAULT: off -LOC: Config.onoff.single_parent_bypass -DOC_START - This tag specifies that it is okay to bypass the hierarchy - "Pinging" when there is only a single parent for a given URL. - - Usage: single_parent_bypass on|off - - Before actually sending ICP "ping" packets to parents and - neighbors, we figure out which hosts would be pinged based - on the cache_host_domain rules, etc. Often it may be the - case that only a single parent cache would be pinged. - - Since there is only a single parent, there is a very good - chance that we will end up fetching the object from that - parent. For this reason, it may be beneficial to avoid - the ping and just fetch the object anyway. - - However, if we avoid the ping, we will be assuming that the - parent host is reachable and that the cache process is running. - By using the ping, we can be reasonably sure that the parent - host will be able to handle our request. If the ping fails then - it may be possible to fetch the object directly from the source. - - To favor the resiliency provided by the ping algorithm, - single_parent_bypass is 'off' by default. - -single_parent_bypass off -DOC_END - NAME: neighbor_timeout neighbour_timeout COMMENT: (seconds) DEFAULT: 2 seconds diff --git a/src/client_side.cc b/src/client_side.cc index 0286fcd6df..0f521d2730 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.229 1998/03/17 00:38:52 wessels Exp $ + * $Id: client_side.cc,v 1.230 1998/03/17 04:00:12 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -147,11 +147,7 @@ void clientAccessCheckDone(int answer, void *data) { clientHttpRequest *http = data; -#if 0 - char *redirectUrl = NULL; -#else int page_id = -1; -#endif ErrorState *err = NULL; HttpReply *rep; debug(33, 5) ("clientAccessCheckDone: '%s' answer=%d\n", http->uri, answer); @@ -172,7 +168,8 @@ clientAccessCheckDone(int answer, void *data) httpReplyDestroy(rep); } else { debug(33, 5) ("Access Denied: %s\n", http->uri); - debug(33, 5) ("AclMatchedName = %s\n", AclMatchedName ? AclMatchedName : ""); + debug(33, 5) ("AclMatchedName = %s\n", + AclMatchedName ? AclMatchedName : ""); http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, http->request->method, 0); page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName); @@ -837,7 +834,10 @@ clientBuildReplyHeader(clientHttpRequest * http, if (!hdr_len && !strncasecmp(xbuf, "HTTP/", 5) && l > 8 && (isspace(xbuf[8]) || isspace(xbuf[9]))) xmemmove(xbuf + 5, "1.0 ", 4); -#if 0 +#if DONT_FILTER_THESE + /* + * but you might want to if you run Squid as a HTTP accelerator + */ if (strncasecmp(xbuf, "Accept-Ranges:", 14) == 0) continue; if (strncasecmp(xbuf, "Etag:", 5) == 0) diff --git a/src/errorpage.cc b/src/errorpage.cc index 73c672ae7a..d08c25d1e6 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.121 1998/03/07 23:43:05 rousskov Exp $ + * $Id: errorpage.cc,v 1.122 1998/03/17 04:00:13 wessels Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -240,7 +240,10 @@ errorAppendEntry(StoreEntry * entry, ErrorState * err) { HttpReply *rep; MemObject *mem = entry->mem_obj; -#if 0 /* we might have an ok store for put etc */ +#if 0 + /* + * Kostas sez PUT "success" replies might not be STORE_PENDING? + */ assert(entry->store_status == STORE_PENDING); #endif assert(mem != NULL); diff --git a/src/http.cc b/src/http.cc index 58aa75b48f..e4fe0bc0a1 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.255 1998/03/16 21:45:01 wessels Exp $ + * $Id: http.cc,v 1.256 1998/03/17 04:00:13 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -125,7 +125,6 @@ enum { static CNCB httpConnectDone; static CWCB httpSendComplete; -static CWCB *sendHeaderDone; static CWCB httpSendRequestEntry; static PF httpReadReply; @@ -722,6 +721,7 @@ httpSendRequest(int fd, void *data) StoreEntry *entry = httpState->entry; int cfd; peer *p = httpState->peer; + CWCB *sendHeaderDone; debug(11, 5) ("httpSendRequest: FD %d: httpState %p.\n", fd, httpState); buflen = strLen(req->urlpath); @@ -894,7 +894,7 @@ httpRestart(HttpStateData * httpState) { /* restart a botched request from a persistent connection */ debug(11, 2) ("Retrying HTTP request for %s\n", storeUrl(httpState->entry)); - if (httpState->orig_request->method != METHOD_GET) { + if (pumpMethod(httpState->orig_request->method)) { debug(11, 1) ("Potential Coredump: httpRestart %s %s\n", RequestMethodStr[httpState->orig_request->method], storeUrl(httpState->entry)); diff --git a/src/protos.h b/src/protos.h index 23fc25e9dd..1bcd54f52c 100644 --- a/src/protos.h +++ b/src/protos.h @@ -21,11 +21,7 @@ extern void aclDestroyAcls(acl **); extern void aclParseAccessLine(struct _acl_access **); extern void aclParseAclLine(acl **); extern struct _acl *aclFindByName(const char *name); -#if 0 -extern char *aclGetDenyInfoUrl(struct _acl_deny_info_list **, const char *name); -#else extern int aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name); -#endif extern void aclParseDenyInfoLine(struct _acl_deny_info_list **); extern void aclDestroyDenyInfoList(struct _acl_deny_info_list **); extern void aclDestroyRegexList(struct _relist *data); diff --git a/src/squid.h b/src/squid.h index 49f501b637..406434be52 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.164 1998/03/16 20:30:05 wessels Exp $ + * $Id: squid.h,v 1.165 1998/03/17 04:00:16 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -31,7 +31,6 @@ #ifndef SQUID_H #define SQUID_H - #include "config.h" /* @@ -307,7 +306,6 @@ struct rusage { #endif #include "md5.h" - #include "Stack.h" #ifdef SQUID_SNMP diff --git a/src/structs.h b/src/structs.h index 7021108d09..bded2f3796 100644 --- a/src/structs.h +++ b/src/structs.h @@ -310,7 +310,6 @@ struct _SquidConfig { int common_log; int log_mime_hdrs; int ident_lookup; - int single_parent_bypass; int log_fqdn; int announce; int accel_with_proxy; @@ -1012,11 +1011,7 @@ struct _request_t { char login[MAX_LOGIN_SZ]; char host[SQUIDHOSTNAMELEN + 1]; u_short port; -#if 0 /* trying new interface */ - char urlpath[MAX_URL]; -#else String urlpath; -#endif int link_count; /* free when zero */ int flags; time_t max_age; diff --git a/src/urn.cc b/src/urn.cc index 30e92deff4..d21ff2472d 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -155,9 +155,6 @@ urnStart(request_t * r, StoreEntry * e) static void urnHandleReply(void *data, char *buf, ssize_t size) { -#if 0 - LOCAL_ARRAY(char, line, 4096); -#endif UrnState *urnState = data; StoreEntry *e = urnState->entry; StoreEntry *urlres_e = urnState->urlres_e; @@ -166,12 +163,7 @@ urnHandleReply(void *data, char *buf, ssize_t size) wordlist *w; wordlist *urls; wordlist *min_w; -#if 0 - int l; - String *S; -#else MemBuf mb; -#endif ErrorState *err; double tmprtt; StoreEntry *tmpentry;