From: Amos Jeffries Date: Mon, 18 Mar 2013 06:24:15 +0000 (-0600) Subject: Polish: drop a bunch of dead code X-Git-Tag: SQUID_3_4_0_1~231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e412456e61e8500e8537da20253a2371c81a9cd3;p=thirdparty%2Fsquid.git Polish: drop a bunch of dead code --- diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 1a646a8e65..fffa869c60 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -159,18 +159,6 @@ HttpReply::pack() return mb; } -#if DEAD_CODE -MemBuf * -httpPackedReply(Http::StatusCode status, const char *ctype, int64_t clen, time_t lmt, time_t expires) -{ - HttpReply *rep = new HttpReply; - rep->setHeaders(status, ctype, NULL, clen, lmt, expires); - MemBuf *mb = rep->pack(); - delete rep; - return mb; -} -#endif - HttpReply * HttpReply::make304() const { diff --git a/src/HttpReply.h b/src/HttpReply.h index 04e95d70ed..c7f3f3e364 100644 --- a/src/HttpReply.h +++ b/src/HttpReply.h @@ -37,11 +37,6 @@ void httpReplyInitModule(void); -#if DEAD_CODE -/** do everything in one call: init, set, pack, clean, return MemBuf */ -MemBuf *httpPackedReply(Http::ProtocolVersion ver, Http::StatusCode status, const char *ctype, int64_t clen, time_t lmt, time_t expires); -#endif - /* Sync changes here with HttpReply.cc */ class HttpHdrContRange; diff --git a/src/acl/SourceAsn.h b/src/acl/SourceAsn.h index 448709b263..ed2cc2023d 100644 --- a/src/acl/SourceAsn.h +++ b/src/acl/SourceAsn.h @@ -28,18 +28,14 @@ * * Copyright (c) 2003, Robert Collins */ -#ifndef SQUID_ACLSOURCEASN_H -#define SQUID_ACLSOURCEASN_H - -#if 0 -#include "acl/Asn.h" -#endif - -class ACLChecklist; +#ifndef SQUID_ACL_SOURCEASN_H +#define SQUID_ACL_SOURCEASN_H #include "acl/Strategy.h" #include "ip/Address.h" +class ACLChecklist; + class ACLSourceASNStrategy : public ACLStrategy { @@ -58,4 +54,4 @@ private: ACLSourceASNStrategy&operator=(ACLSourceASNStrategy const &); }; -#endif /* SQUID_ACLSOURCEASN_H */ +#endif /* SQUID_ACL_SOURCEASN_H */ diff --git a/src/anyp/PortCfg.cc b/src/anyp/PortCfg.cc index b645879699..9bc183c38d 100644 --- a/src/anyp/PortCfg.cc +++ b/src/anyp/PortCfg.cc @@ -67,7 +67,7 @@ AnyP::PortCfg::clone() const b->tcp_keepalive = tcp_keepalive; #if 0 - // AYJ: 2009-07-18: for now SSL does not clone. Configure separate ports with IPs and SSL settings + // TODO: AYJ: 2009-07-18: for now SSL does not clone. Configure separate ports with IPs and SSL settings #if USE_SSL char *cert; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index f5b16aefa5..d299a5afe0 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1305,15 +1305,6 @@ clientReplyContext::buildReplyHeader() * age calculation is performed by adjusting the timestamp in * StoreEntry::timestampsSet(), not here. */ -#if DEAD_CODE - // XXX: realy useless? or is there a bug now that this is detatched from the below if-sequence ? - // looks like this pre-if was supposed to be the browser workaround... - if (NULL == http->storeEntry()) - (void) 0; - else if (http->storeEntry()->timestamp < 0) - (void) 0; -#endif - if (EBIT_TEST(http->storeEntry()->flags, ENTRY_SPECIAL)) { hdr->delById(HDR_DATE); hdr->insertTime(HDR_DATE, squid_curtime); diff --git a/src/comm.cc b/src/comm.cc index 0110ba3145..05eaadac5c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -890,23 +890,6 @@ comm_connect_addr(int sock, const Ip::Address &address) } - /* Squid seems to be working fine without this code. With this code, - * we leak memory on many connect requests because of EINPROGRESS. - * If you find that this code is needed, please file a bug report. */ -#if 0 -#if _SQUID_LINUX_ - /* 2007-11-27: - * Linux Debian replaces our allocated AI pointer with garbage when - * connect() fails. This leads to segmentation faults deallocating - * the system-allocated memory when we go to clean up our pointer. - * HACK: is to leak the memory returned since we can't deallocate. - */ - if (errno != 0) { - AI = NULL; - } -#endif -#endif - address.FreeAddrInfo(AI); PROF_stop(comm_connect_addr); diff --git a/src/forward.cc b/src/forward.cc index 5d594e0197..d872d347c4 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1123,10 +1123,6 @@ FwdState::connectStart() serverConn = NULL; if (Comm::IsConnOpen(serverConn)) { flags.connected_okay = true; -#if 0 - if (!serverConn->getPeer()) - serverConn->peerType = HIER_DIRECT; -#endif ++n_tries; request->flags.pinned = true; if (pinned_connection->pinnedAuth()) diff --git a/src/fqdncache.cc b/src/fqdncache.cc index d4c4535eb3..30af8d38cd 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -702,25 +702,6 @@ fqdnStats(StoreEntry * sentry) } } -/// \ingroup FQDNCacheAPI -#if 0 -const char * -fqdnFromAddr(const Ip::Address &addr) -{ - const char *n; - static char buf[MAX_IPSTRLEN]; - - if (Config.onoff.log_fqdn && (n = fqdncache_gethostbyaddr(addr, 0))) - return n; - -/// \todo Perhapse this should use toHostname() instead of straight NtoA. -/// that would wrap the IPv6 properly when raw. - addr.NtoA(buf, MAX_IPSTRLEN); - - return buf; -} -#endif - /// \ingroup FQDNCacheInternal static void fqdncacheLockEntry(fqdncache_entry * f) diff --git a/src/fs/ufs/StoreFSufs.cc b/src/fs/ufs/StoreFSufs.cc index c1162d13b8..2eaee557fd 100644 --- a/src/fs/ufs/StoreFSufs.cc +++ b/src/fs/ufs/StoreFSufs.cc @@ -34,16 +34,8 @@ /*TODO: remove this file as unused*/ #include "squid.h" -#if 0 -#include "StoreFileSystem.h" -#endif - #include "fs/ufs/StoreFSufs.h" #include "fs/ufs/UFSSwapDir.h" -#if 0 -#include "DiskIO/DiskIOModule.h" -#endif - /* Unused variable: */ Fs::Ufs::StoreFSufs *UfsInstance_foo = NULL; diff --git a/src/ftp.cc b/src/ftp.cc index 9c7e1c0007..e031886aee 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -698,22 +698,6 @@ FtpStateData::ftpTimeout(const CommTimeoutCbParams &io) /* failed() closes ctrl.conn and frees ftpState */ } -#if DEAD_CODE // obsoleted by ERR_DIR_LISTING -void -FtpStateData::listingFinish() -{ - // TODO: figure out what this means and how to show it ... - - if (flags.listformat_unknown && !flags.tried_nlst) { - printfReplyBody("[As plain directory]\n", - flags.dir_slash ? rfc1738_escape_part(old_filepath) : "."); - } else if (typecode == 'D') { - const char *path = flags.dir_slash ? filepath : "."; - printfReplyBody("[As extended directory]\n", rfc1738_escape_part(path)); - } -} -#endif /* DEAD_CODE */ - /// \ingroup ServerProtocolFTPInternal static const char *Month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", diff --git a/src/icmp/IcmpSquid.cc b/src/icmp/IcmpSquid.cc index d2cd6a647d..16c8d2e3ff 100644 --- a/src/icmp/IcmpSquid.cc +++ b/src/icmp/IcmpSquid.cc @@ -51,9 +51,6 @@ IcmpSquid icmpEngine; #if USE_ICMP #define S_ICMP_ECHO 1 -#if DEAD_CODE -#define S_ICMP_ICP 2 -#endif #define S_ICMP_DOM 3 static void * hIpc; diff --git a/src/icmp/net_db.cc b/src/icmp/net_db.cc index 504e5b023c..f1996572aa 100644 --- a/src/icmp/net_db.cc +++ b/src/icmp/net_db.cc @@ -989,23 +989,6 @@ netdbFreeMemory(void) #endif } -#if 0 // AYJ: Looks to be unused code. -int -netdbHops(Ip::Address &addr) -{ -#if USE_ICMP - netdbEntry *n = netdbLookupAddr(addr); - - if (n && n->pings_recv) { - n->last_use_time = squid_curtime; - return (int) (n->hops + 0.5); - } - -#endif - return 256; -} -#endif - void netdbDump(StoreEntry * sentry) { diff --git a/src/ip/Address.cc b/src/ip/Address.cc index dda6fa12c7..1bb97c578e 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -400,10 +400,6 @@ Ip::Address::LookupHostIP(const char *s, bool nodns) if (nodns) { want.ai_flags = AI_NUMERICHOST; // prevent actual DNS lookups! } -#if 0 - else if (!Ip::EnableIpv6) - want.ai_family = AF_INET; // maybe prevent IPv6 DNS lookups. -#endif if ( (err = getaddrinfo(s, NULL, &want, &res)) != 0) { debugs(14,3, HERE << "Given Non-IP '" << s << "': " << gai_strerror(err) ); diff --git a/src/stat.cc b/src/stat.cc index a114896e52..db19c90ccc 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -2039,12 +2039,6 @@ statClientRequests(StoreEntry * s) storeAppendPrintf(s, "req_sz %ld\n", (long int) http->req_sz); e = http->storeEntry(); storeAppendPrintf(s, "entry %p/%s\n", e, e ? e->getMD5Text() : "N/A"); -#if 0 - /* Not a member anymore */ - e = http->old_entry; - storeAppendPrintf(s, "old_entry %p/%s\n", e, e ? e->getMD5Text() : "N/A"); -#endif - storeAppendPrintf(s, "start %ld.%06d (%f seconds ago)\n", (long int) http->start_time.tv_sec, (int) http->start_time.tv_usec,