]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove a lot of unwanted ifdef'd out code (#826) 4.15-20210527-snapshot 5.0.6-20210527-snapshot 6.0.0-20210527-master-snapshot
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 26 May 2021 13:59:53 +0000 (13:59 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 26 May 2021 21:02:57 +0000 (21:02 +0000)
We examined most `#if...` clauses and removed those we decided are
clearly unwanted now. Most of the removed code snippets were unused for
many years or represented stale ideas. We tried to check (at least
superficially) all clauses, but most likely missed some good candidates.

82 files changed:
compat/fdsetsize.h
compat/getaddrinfo.h
compat/getnameinfo.cc
compat/inet_pton.cc
compat/os/aix.h
compat/strtoll.c
compat/tempnam.c
include/asn1.h
include/radix.h
include/snmp-mib.h
include/snmp_api.h
include/snmp_impl.h
include/snmp_pdu.h
lib/heap.c
lib/radix.c
lib/rfc1123.c
lib/rfcnb/rfcnb-io.c
lib/rfcnb/rfcnb-priv.h
lib/smblib/smbencrypt.c
lib/snmplib/asn1.c
lib/snmplib/parse.c
lib/snmplib/snmp_pdu.c
lib/snmplib/snmp_vars.c
src/CacheDigest.cc
src/ConfigParser.cc
src/DiskIO/DiskDaemon/DiskDaemonDiskIOModule.cc
src/DiskIO/DiskDaemon/DiskdIOStrategy.cc
src/MemObject.cc
src/acl/external/eDirectory_userip/ext_edirectory_userip_acl.cc
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/Xaction.cc
src/anyp/Uri.cc
src/auth/digest/Config.cc
src/auth/digest/eDirectory/edir_ldapext.cc
src/cache_cf.cc
src/cache_manager.cc
src/cf_gen.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/client_side_request.h
src/clients/FtpGateway.cc
src/comm.cc
src/comm.h
src/comm/ModSelect.cc
src/comm/ModSelectWin32.cc
src/comm/TcpAcceptor.cc
src/dns/rfc1035.cc
src/dns/rfc3596.cc
src/esi/Esi.cc
src/esi/Include.cc
src/fs/ufs/UFSSwapLogParser.cc
src/fs_io.cc
src/http.cc
src/http/RegisteredHeadersHash.cci
src/http/Stream.cc
src/log/ModUdp.cc
src/mem/old_api.cc
src/mgr/QueryParams.cc
src/peer_digest.cc
src/sbuf/SBuf.cc
src/security/Session.cc
src/stat.cc
src/store.cc
src/store_client.cc
src/tests/SBufFindTest.cc
src/tests/stub_comm.cc
src/tests/testCacheManager.cc
src/tests/testHttp1Parser.cc
src/tests/testIpAddress.cc
src/tests/testStoreController.cc
src/tests/testStoreHashIndex.cc
src/tests/testUfs.cc
src/tests/testUriScheme.cc
src/tests/testUriScheme.h
test-suite/ESIExpressions.cc
test-suite/pconn-banger.c
test-suite/tcp-banger3.c
tools/cachemgr.cc
tools/purge/purge.cc
tools/purge/signal.cc
tools/purge/signal.hh

index a0a1848578272cce7a682a4ced2a845f38c49fa8..b7b315a4a7d716ccdbb9fb050448746491fb35ce 100644 (file)
  *--------------------------------------------------------------------------*
  ****************************************************************************/
 
-/* FD_SETSIZE must be redefined before including sys/types.h */
-#if 0
-/* AYJ: would dearly like to use this to enforce include order
-    but at present some helpers don't follow the squid include methodology.
-    that will need fixing later.
-*/
-#ifdef _SYS_TYPES_H
-#error squid_fdsetsize.h for FDSETSIZE must be included before sys/types.h
-#error Make sure that squid.h is the first file included by your .cc
-#endif
-#endif /* 0 */
 /*
  * On some systems, FD_SETSIZE is set to something lower than the
  * actual number of files which can be opened.  IRIX is one case,
index 69696d0a6744066ae23f5535a80b4f4589fb02b2..9744844944af5a8b8189e387c82fe9cb85bc329d 100644 (file)
 /* These functions are provided by the OS */
 #if !HAVE_DECL_GETADDRINFO
 
-/* SG 23/09/2007:
-On Windows the following definitions are already available, may be that
-this could be needed on some other platform */
-#if 0
-struct addrinfo {
-    int ai_flags;       /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
-    int ai_family;      /* PF_xxx */
-    int ai_socktype;        /* SOCK_xxx */
-    int ai_protocol;        /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
-    socklen_t ai_addrlen;   /* length of ai_addr */
-    char *ai_canonname;     /* canonical name for nodename */
-    struct sockaddr *ai_addr;   /* binary address */
-    struct addrinfo *ai_next;   /* next structure in linked list */
-};
-
-/* Supposed to be defined in <netdb.h> */
-#define AI_PASSIVE     1       /* Socket address is intended for `bind'.  */
-#define AI_CANONNAME   2       /* Request for canonical name.  */
-#define AI_NUMERICHOST 4       /* Don't use name resolution.  */
-
-/* Supposed to be defined in <netdb.h> */
-#define EAI_ADDRFAMILY 1   /* address family for nodename not supported */
-#define EAI_AGAIN      2   /* temporary failure in name resolution */
-#define EAI_BADFLAGS   3   /* invalid value for ai_flags */
-#define EAI_FAIL       4   /* non-recoverable failure in name resolution */
-#define EAI_FAMILY     5   /* ai_family not supported */
-#define EAI_MEMORY     6   /* memory allocation failure */
-#define EAI_NODATA     7   /* no address associated with nodename */
-#define EAI_NONAME     8   /* nodename nor servname provided, or not known */
-#define EAI_SERVICE    9   /* servname not supported for ai_socktype */
-#define EAI_SOCKTYPE   10  /* ai_socktype not supported */
-#endif
 #ifndef EAI_SYSTEM
 /* Not defined on mingw32. */
 #define EAI_SYSTEM     11  /* System error returned in `errno'.  */
index b0bb7afd14a204cbac2353ee79841531dc5e98d0..7a458de8989eb4e8ca491c1fcf7a8c648d3d6ebc 100644 (file)
@@ -265,36 +265,9 @@ found:
         hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error);
 #else
         hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af);
-#if 0 // getnameinfo.c:161:9: error: variable 'h_error' set but not used
-#if HAVE_H_ERRNO
-        h_error = h_errno;
-#else
-        h_error = EINVAL;
-#endif
-#endif /* 0 */
 #endif
 
         if (hp) {
-#if 0
-            if (flags & NI_NOFQDN) {
-                /*
-                 * According to RFC3493 section 6.2, NI_NOFQDN
-                 * means "node name portion of the FQDN shall
-                 * be returned for local hosts."  The following
-                 * code tries to implement it by returning the
-                 * first label (the part before the first
-                 * period) of the FQDN.  However, it is not
-                 * clear if this always makes sense, since the
-                 * given address may be outside of "local
-                 * hosts."  Due to the unclear description, we
-                 * disable the code in this implementation.
-                 */
-                char *p;
-                p = strchr(hp->h_name, '.');
-                if (p)
-                    *p = '\0';
-            }
-#endif
             if (strlen(hp->h_name) + 1 > hostlen) {
 #if USE_GETIPNODEBY
                 freehostent(hp);
index e30462bb101295539f3e5c9adc6dd2c59377c2ab..cbcd1e11744b29b96dadb67a9f622363de42d7d6 100644 (file)
@@ -63,7 +63,7 @@ static const char rcsid[] = "inet_pton.c,v 1.2.206.2 2005/07/28 07:43:18 marka E
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if ARPA_INET_H
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 #if HAVE_ARPA_NAMESER_H
index 8d1c1df5d0288a9315cf54af1173ea3c452bd020..d1be71d9a6f68a83ef3c57de828cfd0e975cb512 100644 (file)
 #define _XOPEN_SOURCE_EXTENDED 1
 #endif
 
-/* AIX 6.1 does not define recvmsg() flag MSG_DONTWAIT */
-#if !defined(MSG_DONTWAIT)
-#define MSG_DONTWAIT 0
-#endif
-
 #endif /* _SQUID_AIX_ */
 #endif /* SQUID_OS_AIX_H */
 
index e817d0473db6dfa961eca55d6148fcea2dbcb750..fe3467adb08779c4d04de7d6ee64de2220eff082 100644 (file)
 #include <errno.h>
 #endif
 
-#ifndef INT64_MIN
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MIN) && (SIZEOF_LONG == 8)
-#define INT64_MIN LONG_MIN
-#else
-/* 32 bit system */
-#define INT64_MIN       (-9223372036854775807LL-1LL)
-#endif
-#endif
-
-#ifndef INT64_MAX
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MAX) && (SIZEOF_LONG == 8)
-#define INT64_MAX LONG_MAX
-#else
-/* 32 bit system */
-#define INT64_MAX       9223372036854775807LL
-#endif
-#endif
-
 /*
  * Convert a string to a int64 integer.
  *
index 12622b773d47b9e6b221ebee6d4b72c1d0a22c7a..38d3443581056a1594b0114f7bbfa73b9c88eb49 100644 (file)
@@ -121,18 +121,3 @@ tempnam(const char *dir, const char *pfx)
     return _tmpnam();
 }
 
-#ifdef TEST
-int
-main()
-{
-    char *t;
-    int n = 0;
-    while ((t = tempnam(NULL, NULL))) {
-        printf("%s\n", t);
-        if (++n == 1000)
-            break;
-    }
-    return 1;
-}
-#endif
-
index 3e99cf1a444690cb0768b0acc6db6bf5d6125d21..8d32dd1454f874a39e2f6468e2eac31642b3feaf 100644 (file)
@@ -93,11 +93,6 @@ u_char *asn_build_objid(u_char *, int *, u_char, oid *, int);
 u_char *asn_parse_null(u_char *, int *, u_char *);
 u_char *asn_build_null(u_char *, int *, u_char);
 
-#if 0
-u_char *asn_parse_bitstring(u_char *, int *, u_char *, u_char *, int *);
-u_char *asn_build_bitstring(u_char *, int *, u_char, u_char *, int);
-
-#endif
 u_char *asn_build_exception(u_char *, int *, u_char);
 
 #ifdef __cplusplus
index 1e00dd4b70c8e27e6c35380e301b4d3d0a58e6d2..fc1a7ef530c3b84a0c423a476f7157514e2a670b 100644 (file)
@@ -44,7 +44,6 @@
  *      @(#)radix.h     8.2 (Berkeley) 10/31/94
  */
 
-#undef RN_DEBUG
 /*
  * Radix search tree node layout.
  */
@@ -78,14 +77,6 @@ struct squid_radix_node {
             struct squid_radix_node *rn_R;  /* progeny */
         } rn_node;
     } rn_u;
-#ifdef RN_DEBUG
-
-    int rn_info;
-
-    struct squid_radix_node *rn_twin;
-
-    struct squid_radix_node *rn_ybro;
-#endif
 };
 
 #define rn_key rn_u.rn_leaf.rn_Key
index 33a3720ee6939153f0bffc52c5006684bc0d1e53..ea3bb232edeb4a138583caacc76d1f65f7e4c25f 100644 (file)
@@ -37,9 +37,6 @@
 
 #include <asn1.h>       /* Need OID Definition */
 #include <snmp_vars.h>      /* Need variable_list */
-#if 0
-#include <mib.h>        /* Then the function definitions */
-#endif
 
 #endif /* SQUID_SNMP_MIB_H */
 
index 11a467f0740749e197cb85a3cc3843694362fffe..7ab0a2fb4597d9928f7270ce5457b78da59ab645 100644 (file)
@@ -63,114 +63,6 @@ u_char *snmp_parse(struct snmp_session *, struct snmp_pdu *, u_char *, int);
  */
 int snmp_build(struct snmp_session *, struct snmp_pdu *, u_char *, int *);
 
-/*
- * struct snmp_session *snmp_open(session)
- *      struct snmp_session *session;
- *
- * Sets up the session with the snmp_session information provided
- * by the user.  Then opens and binds the necessary UDP port.
- * A handle to the created session is returned (this is different than
- * the pointer passed to snmp_open()).  On any error, NULL is returned
- * and snmp_errno is set to the appropriate error code.
- */
-#if 0
-struct snmp_session *snmp_open(struct snmp_session *);
-
-/*
- * int snmp_close(session)
- *     struct snmp_session *session;
- *
- * Close the input session.  Frees all data allocated for the session,
- * dequeues any pending requests, and closes any sockets allocated for
- * the session.  Returns 0 on error, 1 otherwise.
- */
-int snmp_close(struct snmp_session *);
-
-/*
- * int snmp_send(session, pdu)
- *     struct snmp_session *session;
- *     struct snmp_pdu  *pdu;
- *
- * Sends the input pdu on the session after calling snmp_build to create
- * a serialized packet.  If necessary, set some of the pdu data from the
- * session defaults.  Add a request corresponding to this pdu to the list
- * of outstanding requests on this session, then send the pdu.
- * Returns the request id of the generated packet if applicable, otherwise 1.
- * On any error, 0 is returned.
- * The pdu is freed by snmp_send() unless a failure occurred.
- */
-int snmp_send(struct snmp_session *, struct snmp_pdu *);
-
-/*
- * void snmp_read(fdset)
- *     fd_set  *fdset;
- *
- * Checks to see if any of the fd's set in the fdset belong to
- * snmp.  Each socket with it's fd set has a packet read from it
- * and snmp_parse is called on the packet received.  The resulting pdu
- * is passed to the callback routine for that session.  If the callback
- * routine returns successfully, the pdu and it's request are deleted.
- */
-void snmp_read(fd_set *);
-
-/*
- * int snmp_select_info(numfds, fdset, timeout, block)
- * int *numfds;
- * fd_set   *fdset;
- * struct timeval *timeout;
- * int *block;
- *
- * Returns info about what snmp requires from a select statement.
- * numfds is the number of fds in the list that are significant.
- * All file descriptors opened for SNMP are OR'd into the fdset.
- * If activity occurs on any of these file descriptors, snmp_read
- * should be called with that file descriptor set.
- *
- * The timeout is the latest time that SNMP can wait for a timeout.  The
- * select should be done with the minimum time between timeout and any other
- * timeouts necessary.  This should be checked upon each invocation of select.
- * If a timeout is received, snmp_timeout should be called to check if the
- * timeout was for SNMP.  (snmp_timeout is idempotent)
- *
- * Block is 1 if the select is requested to block indefinitely, rather than time out.
- * If block is input as 1, the timeout value will be treated as undefined, but it must
- * be available for setting in snmp_select_info.  On return, if block is true, the value
- * of timeout will be undefined.
- *
- * snmp_select_info returns the number of open sockets.  (i.e. The number of sessions open)
- */
-int snmp_select_info(int *, fd_set *, struct timeval *, int *);
-
-/*
- * void snmp_timeout();
- *
- * snmp_timeout should be called whenever the timeout from snmp_select_info expires,
- * but it is idempotent, so snmp_timeout can be polled (probably a cpu expensive
- * proposition).  snmp_timeout checks to see if any of the sessions have an
- * outstanding request that has timed out.  If it finds one (or more), and that
- * pdu has more retries available, a new packet is formed from the pdu and is
- * resent.  If there are no more retries available, the callback for the session
- * is used to alert the user of the timeout.
- */
-void snmp_timeout(void);
-
-/*
- * This routine must be supplied by the application:
- *
- * int callback(operation, session, reqid, pdu, magic)
- * int operation;
- * struct snmp_session *session;    The session authenticated under.
- * int reqid;                       The request id of this pdu (0 for TRAP)
- * struct snmp_pdu *pdu;            The pdu information.
- * void *magic                      A link to the data for this routine.
- *
- * Returns 1 if request was successful, 0 if it should be kept pending.
- * Any data in the pdu must be copied because it will be freed elsewhere.
- * Operations are defined below:
- */
-
-void snmp_api_stats(void *);
-#endif
 #ifdef __cplusplus
 }
 
index 9a382124f8852c4b0c5763a555784f7cdd5b8f96..705b85455cc546b0ed38ea0a9bbf669df2e3deb6 100644 (file)
@@ -38,18 +38,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 SOFTWARE.
 ******************************************************************/
 
-#if 0
-#if (defined vax) || (defined (mips))
-/*
- * This is a fairly bogus thing to do, but there seems to be no better way for
- * compilers that don't understand void pointers.
- */
-#ifndef void
-#define void char
-#endif
-#endif
-#endif
-
 #define SID_MAX_LEN 64
 
 #define READ        1
index 133eca193db5a03bc54adf2050e3340429b4fea6..4bb7f55f2d4d32f850444a46a6150f4e09cfff30 100644 (file)
@@ -92,38 +92,13 @@ void snmp_add_null_var(struct snmp_pdu *, oid *, int);
 #define SNMP_PDU_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
 #define SNMP_PDU_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
 #define SNMP_PDU_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
-#ifdef UNUSED_CODE
-#define SNMP_PDU_SET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3)
-#define TRP_REQ_MSG     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)   /*Obsolete */
-#endif
 #define SNMP_PDU_GETBULK    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
-#ifdef UNUSED_CODE
-#define SNMP_PDU_INFORM     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
-#define SNMP_PDU_V2TRAP     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
-#define SNMP_PDU_REPORT     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
-#endif
 #define MAX_BINDINGS 2147483647 /* PDU Defaults */
 #define SNMP_DEFAULT_ERRSTAT        -1
 #define SNMP_DEFAULT_ERRINDEX       -1
 #define SNMP_DEFAULT_ADDRESS        0
 #define SNMP_DEFAULT_REQID      0
 
-/* RFC 1907: Management Information Base for SNMPv2
- *
- * RFC 1157: A Simple Network Management Protocol (SNMP)
- *
- * Trap Types
- */
-#if UNUSED_CODE
-#define SNMP_TRAP_COLDSTART             (0x0)
-#define SNMP_TRAP_WARMSTART             (0x1)
-#define SNMP_TRAP_LINKDOWN              (0x2)
-#define SNMP_TRAP_LINKUP                (0x3)
-#define SNMP_TRAP_AUTHENTICATIONFAILURE (0x4)
-#define SNMP_TRAP_EGPNEIGHBORLOSS       (0x5)
-#define SNMP_TRAP_ENTERPRISESPECIFIC    (0x6)
-#endif
-
 #ifdef __cplusplus
 }
 #endif
index a99cddccb35d6d965190ed7e732c76b52f04ce4c..d349d2fc5f331e7b63f60773fdf1bfcbb5cb5771 100644 (file)
@@ -374,19 +374,6 @@ _heap_swap_element(heap * hp, heap_node * elm1, heap_node * elm2)
     hp->nodes[elm2->id] = elm2;
 }
 
-#ifdef  NOTDEF
-/*
- * Copy KEY and DATA fields of SRC to DEST. ID field is NOT copied.
- */
-static void
-_heap_copy_element(heap_node * src, heap_node * dest)
-{
-    dest->key = src->key;
-    dest->data = src->data;
-}
-
-#endif /* NOTDEF */
-
 /*
  * True if HP needs to be grown in size.
  */
@@ -412,12 +399,6 @@ _heap_grow(heap * hp)
         newSize = hp->size * NormalRate;
 
     hp->nodes = xrealloc(hp->nodes, newSize * sizeof(heap_node *));
-#if COMMENTED_OUT
-    for (i = 0; i < hp->size; i++)
-        newNodes[i] = hp->nodes[i];
-    xfree(hp->nodes);
-    hp->nodes = newNodes;
-#endif
     hp->size = newSize;
 }
 
index c0208a022df3935791860cc6a3bbf1bd10710581..817b2b77921d933e6ee0151949570a178878c5d1 100644 (file)
@@ -340,13 +340,6 @@ on1:
     return 0;
 }
 
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct squid_radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
 struct squid_radix_node *
 squid_rn_newpair(void *v, int b, struct squid_radix_node nodes[2]) {
     register struct squid_radix_node *tt = nodes, *t = tt + 1;
@@ -358,13 +351,6 @@ squid_rn_newpair(void *v, int b, struct squid_radix_node nodes[2]) {
     tt->rn_key = (caddr_t) v;
     tt->rn_p = t;
     tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
-    tt->rn_info = rn_nodenum++;
-    t->rn_info = rn_nodenum++;
-    tt->rn_twin = t;
-    tt->rn_ybro = rn_clist;
-    rn_clist = tt;
-#endif
     return t;
 }
 
@@ -406,11 +392,6 @@ on1:
             else
                 x = x->rn_l;
         } while (b > (unsigned) x->rn_b);   /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
-        if (rn_debug)
-            fprintf(stderr, "squid_rn_insert: Going In:\n");
-        traverse(p);
-#endif
         t = squid_rn_newpair(v_arg, b, nodes);
         tt = t->rn_l;
         if ((cp[p->rn_off] & p->rn_bmask) == 0)
@@ -425,10 +406,6 @@ on1:
             t->rn_r = tt;
             t->rn_l = x;
         }
-#ifdef RN_DEBUG
-        if (rn_debug)
-            log(LOG_DEBUG, "squid_rn_insert: Coming Out:\n"), traverse(p);
-#endif
     }
     return (tt);
 }
@@ -606,14 +583,6 @@ squid_rn_addroute(void *v_arg, void *n_arg, struct squid_radix_node_head *head,
             tt->rn_dupedkey = t->rn_dupedkey;
             t->rn_dupedkey = tt;
         }
-#ifdef RN_DEBUG
-        t = tt + 1;
-        tt->rn_info = rn_nodenum++;
-        t->rn_info = rn_nodenum++;
-        tt->rn_twin = t;
-        tt->rn_ybro = rn_clist;
-        rn_clist = tt;
-#endif
         tt->rn_key = (caddr_t) v;
         tt->rn_b = -1;
         tt->rn_flags = RNF_ACTIVE;
@@ -762,13 +731,6 @@ on1:
      */
     if (tt->rn_flags & RNF_ROOT)
         return (0);
-#ifdef RN_DEBUG
-    /* Get us out of the creation list */
-    for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {
-    }
-    if (t)
-        t->rn_ybro = tt->rn_ybro;
-#endif
     t = tt->rn_p;
     if ((dupedkey = saved_tt->rn_dupedkey)) {
         if (tt == saved_tt) {
@@ -788,15 +750,8 @@ on1:
         }
         t = tt + 1;
         if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
-            *++x = *t;
-            p = t->rn_p;
-#else
-            b = t->rn_info;
             *++x = *t;
-            t->rn_info = b;
             p = t->rn_p;
-#endif
             if (p->rn_l == t)
                 p->rn_l = x;
             else
@@ -836,13 +791,7 @@ on1:
                         squid_MKFree(m);
                     m = mm;
                 }
-#if RN_DEBUG
-            if (m)
-                fprintf(stderr, "%s %x at %x\n",
-                        "squid_rn_delete: Orphaned Mask", (int) m, (int) x);
-#else
             assert(m == NULL);
-#endif
         }
     }
     /*
@@ -850,13 +799,7 @@ on1:
      */
     x = tt + 1;
     if (t != x) {
-#ifndef RN_DEBUG
-        *t = *x;
-#else
-        b = t->rn_info;
         *t = *x;
-        t->rn_info = b;
-#endif
         t->rn_l->rn_p = t;
         t->rn_r->rn_p = t;
         p = x->rn_p;
index 2d889cca497c08b0b293a423ef5fcfe7c82ea736..175b6a1e9da2ce6f3d3c964540bb15139e9efb6a 100644 (file)
@@ -210,20 +210,3 @@ mkrfc1123(time_t t)
     return buf;
 }
 
-#if 0
-int
-main()
-{
-    char *x;
-    time_t t, pt;
-
-    t = time(NULL);
-    x = mkrfc1123(t);
-    printf("HTTP Time: %s\n", x);
-
-    pt = parse_rfc1123(x);
-    printf("Parsed: %d vs. %d\n", pt, t);
-}
-
-#endif
-
index 60bf9451e97c14ca1ee39a0fe3de278e2b9ad6b3..326809f8901d568e12a820b48ab7aea9b34d83ef 100644 (file)
 
 int RFCNB_Timeout = 0;          /* Timeout in seconds ... */
 
-static int RFCNB_Discard_Rest(struct RFCNB_Con *con, int len);
-
-#ifdef NOT_USED
-void
-rfcnb_alarm(int sig)
-{
-
-    fprintf(stderr, "IO Timed out ...\n");
-
-}
-
-#endif /* NOT_USED */
-
-#ifdef NOT_USED
-/* Set timeout value and setup signal handling */
-int
-RFCNB_Set_Timeout(int seconds)
-{
-    /* If we are on a Bezerkeley system, use sigvec, else sigaction */
-
-#if ORIGINAL_SAMBA_CODE
-#ifndef SA_RESTART
-    struct sigvec invec, outvec;
-#else
-    struct sigaction inact, outact;
-#endif
-
-    RFCNB_Timeout = seconds;
-
-    if (RFCNB_Timeout > 0) {    /* Set up handler to ignore but not restart */
-
-#ifndef SA_RESTART
-        invec.sv_handler = (void (*)()) rfcnb_alarm;
-        invec.sv_mask = 0;
-        invec.sv_flags = SV_INTERRUPT;
-
-        if (sigvec(SIGALRM, &invec, &outvec) < 0)
-            return (-1);
-#else /* !SA_RESTART */
-        inact.sa_handler = (void (*)()) rfcnb_alarm;
-#ifdef Solaris
-        /* Solaris seems to have an array of vectors ... */
-        inact.sa_mask.__sigbits[0] = 0;
-        inact.sa_mask.__sigbits[1] = 0;
-        inact.sa_mask.__sigbits[2] = 0;
-        inact.sa_mask.__sigbits[3] = 0;
-#else /* !Solaris */
-        inact.sa_mask = (sigset_t) 0;
-#endif /* Solaris */
-        inact.sa_flags = 0;     /* Don't restart */
-
-        if (sigaction(SIGALRM, &inact, &outact) < 0)
-            return (-1);
-
-#endif /* !SA_RESTART */
-
-    }
-#else /* !ORIGINAL_SAMBA_CODE ADAPTED SQUID CODE */
-#if HAVE_SIGACTION
-    struct sigaction inact, outact;
-#else
-    struct sigvec invec, outvec;
-#endif
-
-    RFCNB_Timeout = seconds;
-
-    if (RFCNB_Timeout > 0) {    /* Set up handler to ignore but not restart */
-
-#if HAVE_SIGACTION
-        inact.sa_handler = (void (*)()) rfcnb_alarm;
-        sigemptyset(&inact.sa_mask);
-        inact.sa_flags = 0;     /* Don't restart */
-
-        if (sigaction(SIGALRM, &inact, &outact) < 0)
-            return (-1);
-#else /* !HAVE_SIGACTION */
-        invec.sv_handler = (void (*)()) rfcnb_alarm;
-        invec.sv_mask = 0;
-        invec.sv_flags = SV_INTERRUPT;
-
-        if (sigvec(SIGALRM, &invec, &outvec) < 0)
-            return (-1);
-#endif /* !HAVE_SIGACTION */
-    }
-#endif /* !ORIGINAL_SAMBA_CODE ADAPTED SQUID CODE */
-    return (0);
-}
-#endif /* NOT_USED */
-
 /* Discard the rest of an incoming packet as we do not have space for it
  * in the buffer we allocated or were passed ...                         */
 
+static
 int
 RFCNB_Discard_Rest(struct RFCNB_Con *con, int len)
 {
index 92bba71d1ba89bba88f0d1bac430bd8c6c0caeb9..4f40e74a4659a10b8c748ae5eff3e35e4ec12d0d 100644 (file)
@@ -121,35 +121,6 @@ typedef char RFCNB_Hdr[4];      /* The header is 4 bytes long with  */
 
 #define RFCNB_Pkt_Type(p) (CVAL((p), RFCNB_Pkt_Type_Offset))
 
-#if UNUSED_CODE
-typedef struct RFCNB_Hdr {
-    unsigned char type;
-    unsigned char flags;
-    int16 len;
-} RFCNB_Hdr;
-
-typedef struct RFCNB_Sess_Pkt {
-    unsigned char type;
-    unsigned char flags;
-    int16 length;
-    unsigned char n1_len;
-    char called_name[33];
-    unsigned char n2_len;
-    char calling_name[33];
-} RFCNB_Sess_Pkt;
-
-typedef struct RFCNB_Nack_Pkt {
-    struct RFCNB_Hdr hdr;
-    unsigned char error;
-} RFCNB_Nack_Pkt;
-
-typedef struct RFCNB_Retarget_Pkt {
-    struct RFCNB_Hdr hdr;
-    int dest_ip;
-    unsigned char port;
-} RFCNB_Redir_Pkt;
-#endif /* UNUSED_CODE */
-
 /* Static variables */
 
 /* Only declare this if not defined */
index 8b1f643cf046034c8c030f288750a0fe384b5de1..2aca26a070a73f278a468cb0b4147a2db40da370 100644 (file)
@@ -194,29 +194,9 @@ void
 strupper(char *s)
 {
     while (*s) {
-#if UNUSED_CODE
-#if !defined(KANJI_WIN95_COMPATIBILITY)
-        if (lp_client_code_page() == KANJI_CODEPAGE) {
-
-            if (is_shift_jis(*s)) {
-                if (is_sj_lower(s[0], s[1]))
-                    s[1] = sj_toupper2(s[1]);
-                s += 2;
-            } else if (is_kana(*s)) {
-                s++;
-            } else {
-                if (islower((int)(unsigned char)*s))
-                    *s = toupper((int)(unsigned char)*s);
-                s++;
-            }
-        } else
-#endif /* KANJI_WIN95_COMPATIBILITY */
-#endif /* UNUSED_CODE */
-        {
-            if (islower((int)(unsigned char)*s))
-                *s = toupper((int)(unsigned char)*s);
-            s++;
-        }
+        if (islower((int)(unsigned char)*s))
+            *s = toupper((int)(unsigned char)*s);
+        s++;
     }
 }
 
index 155b05be2e0fa2efc9635a5c2a9bd3aa174b3856..708d626237471e86b6bbdf0be372343755ad5062 100644 (file)
@@ -527,42 +527,6 @@ asn_build_header_with_truth(u_char * data, int *datalength,
     return (asn_build_length(data, datalength, length, truth));
 }
 
-#if 0
-/*
- * asn_build_sequence - builds an ASN header for a sequence with the ID and
- * length specified.
- *  On entry, datalength is input as the number of valid bytes following
- *   "data".  On exit, it is returned as the number of valid bytes
- *   in this object following the id and length.
- *
- *  This only works on data types < 30, i.e. no extension octets.
- *  The maximum length is 0xFFFF;
- *
- *  Returns a pointer to the first byte of the contents of this object.
- *  Returns NULL on any error.
- */
-u_char *
-asn_build_sequence(u_char * data, int *datalength,
-                   u_char type, int length)
-/*    u_char *data;       IN - pointer to start of object */
-/*    int    *datalength; IN/OUT - # of valid bytes left in buffer */
-/*    u_char  type;       IN - ASN type of object */
-/*    int     length;     IN - length of object */
-{
-    *datalength -= 4;
-    if (*datalength < 0) {
-        *datalength += 4;   /* fix up before punting */
-        snmp_set_api_error(SNMPERR_ASN_ENCODE);
-        return (NULL);
-    }
-    *data++ = type;
-    *data++ = (u_char) (0x02 | ASN_LONG_LEN);
-    *data++ = (u_char) ((length >> 8) & 0xFF);
-    *data++ = (u_char) (length & 0xFF);
-    return (data);
-}
-#endif
-
 /*
  * asn_parse_length - interprets the length of the current object.
  *  On exit, length contains the value of this length field.
@@ -825,43 +789,6 @@ asn_build_objid(u_char * data, int *datalength,
     return (data + asnlength);
 }
 
-#if 0
-/*
- * asn_parse_null - Interprets an ASN null type.
- *  On entry, datalength is input as the number of valid bytes following
- *   "data".  On exit, it is returned as the number of valid bytes
- *   following the beginning of the next object.
- *
- *  Returns a pointer to the first byte past the end
- *   of this object (i.e. the start of the next object).
- *  Returns NULL on any error.
- */
-u_char *
-asn_parse_null(u_char * data, int *datalength, u_char * type)
-/*    u_char  *data;       IN - pointer to start of object */
-/*    int     *datalength; IN/OUT - # of valid bytes left in buf */
-/*    u_char  *type;       OUT - ASN type of object */
-{
-    /*
-     * ASN.1 null ::= 0x05 0x00
-     */
-    u_char *bufp = data;
-    u_int asn_length;
-
-    *type = *bufp++;
-    bufp = asn_parse_length(bufp, &asn_length);
-    if (bufp == NULL)
-        return (NULL);
-
-    if (asn_length != 0) {
-        snmp_set_api_error(SNMPERR_ASN_DECODE);
-        return (NULL);
-    }
-    *datalength -= (bufp - data);
-    return (bufp + asn_length);
-}
-#endif
-
 /*
  * asn_build_null - Builds an ASN null object.
  *  On entry, datalength is input as the number of valid bytes following
@@ -884,104 +811,6 @@ asn_build_null(u_char * data, int *datalength, u_char type)
     return (asn_build_header_with_truth(data, datalength, type, 0, 1));
 }
 
-#if 0
-
-/*
- * asn_parse_bitstring - pulls a bitstring out of an ASN bitstring type.
- *  On entry, datalength is input as the number of valid bytes following
- *   "data".  On exit, it is returned as the number of valid bytes
- *   following the beginning of the next object.
- *
- *  "string" is filled with the bit string.
- *
- *  Returns a pointer to the first byte past the end
- *   of this object (i.e. the start of the next object).
- *  Returns NULL on any error.
- */
-u_char *
-asn_parse_bitstring(u_char * data, int *datalength,
-                    u_char * type, u_char * string, int *strlength)
-/*   u_char  *data;        IN - pointer to start of object */
-/*   int     *datalength;  IN/OUT - # of valid bytes left in buf */
-/*   u_char  *type;        OUT - asn type of object */
-/*   u_char  *string;      IN/OUT - pointer to start of output buf */
-/*   int     *strlength;   IN/OUT - size of output buffer */
-{
-    /*
-     * bitstring ::= 0x03 asnlength unused {byte}*
-     */
-    u_char *bufp = data;
-    u_int asn_length;
-
-    *type = *bufp++;
-    bufp = asn_parse_length(bufp, &asn_length);
-    if (bufp == NULL)
-        return (NULL);
-
-    if (asn_length + (bufp - data) > *datalength) {
-        snmp_set_api_error(SNMPERR_ASN_DECODE);
-        return (NULL);
-    }
-    if (asn_length > *strlength) {
-        snmp_set_api_error(SNMPERR_ASN_DECODE);
-        return (NULL);
-    }
-    if (asn_length < 1) {
-        snmp_set_api_error(SNMPERR_ASN_DECODE);
-        return (NULL);
-    }
-    if ((int) (*(char *) bufp) < 0 || (int) (*bufp) > 7) {
-        snmp_set_api_error(SNMPERR_ASN_DECODE);
-        return (NULL);
-    }
-    memcpy((char *) string, (char *) bufp, (int) asn_length);
-    *strlength = (int) asn_length;
-    *datalength -= (int) asn_length + (bufp - data);
-    return (bufp + asn_length);
-}
-
-/*
- * asn_build_bitstring - Builds an ASN bit string object containing the
- * input string.
- *  On entry, datalength is input as the number of valid bytes following
- *   "data".  On exit, it is returned as the number of valid bytes
- *   following the beginning of the next object.
- *
- *  Returns a pointer to the first byte past the end
- *   of this object (i.e. the start of the next object).
- *  Returns NULL on any error.
- */
-u_char *
-asn_build_bitstring(u_char * data, int *datalength,
-                    u_char type, u_char * string, int strlength)
-/*   u_char  *data;       IN - pointer to start of object */
-/*   int     *datalength; IN/OUT - # of valid bytes left in buf */
-/*   u_char   type;       IN - ASN type of string */
-/*   u_char  *string;     IN - pointer to start of input buffer */
-/*   int      strlength;  IN - size of input buffer */
-{
-    /*
-     * ASN.1 bit string ::= 0x03 asnlength unused {byte}*
-     */
-    if ((strlength < 1) || ((*(char *) string) < 0) || ((*string) > 7)) {
-        snmp_set_api_error(SNMPERR_ASN_ENCODE);
-        return (NULL);
-    }
-    data = asn_build_header_with_truth(data, datalength, type, strlength, 1);
-    if (data == NULL)
-        return (NULL);
-
-    if (*datalength < strlength) {
-        snmp_set_api_error(SNMPERR_ASN_ENCODE);
-        return (NULL);
-    }
-    memcpy((char *) data, (char *) string, strlength);
-    *datalength -= strlength;
-    return (data + strlength);
-}
-
-#endif
-
 /*
  * To do: Write an asn_parse_exception function to go with the new
  * asn_build_exception function below so that the exceptional values can
index e07897b86abd77e746094d90306ec16cc052e2d2..ee320a20476e192a5e5f22578fd9e8f9d5e97cec 100644 (file)
@@ -273,29 +273,6 @@ print_error(const char *string, const char *token, int type)
         snmplib_debug(0, "%s: On or around line %d\n", string, Line);
 }
 
-#if TEST
-print_subtree(tree, count)
-struct snmp_mib_tree *tree;
-int count;
-{
-    struct snmp_mib_tree *tp;
-    int i;
-
-    for (i = 0; i < count; i++)
-        printf("  ");
-    printf("Children of %s:\n", tree->label);
-    count++;
-    for (tp = tree->child_list; tp; tp = tp->next_peer) {
-        for (i = 0; i < count; i++)
-            printf("  ");
-        printf("%s\n", tp->label);
-    }
-    for (tp = tree->child_list; tp; tp = tp->next_peer) {
-        print_subtree(tp, count);
-    }
-}
-#endif /* TEST */
-
 int translation_table[40];
 
 static void
@@ -426,9 +403,7 @@ do_subtree(struct snmp_mib_tree *root, struct node **nodes)
         xfree(oldnp);
 }
 
-#if !TEST
 static
-#endif
 struct snmp_mib_tree *
 build_tree(struct node *nodes) {
     struct node *np;
@@ -449,9 +424,6 @@ build_tree(struct node *nodes) {
     init_node_hash(nodes);
     /* XXX nodes isn't needed in do_subtree() ??? */
     do_subtree(tp, &nodes);
-#if TEST
-    print_subtree(tp, 0);
-#endif /* TEST */
     /* If any nodes are left, the tree is probably inconsistent */
     for (bucket = 0; bucket < NHASHSIZE; bucket++) {
         if (nbuckets[bucket]) {
@@ -988,9 +960,7 @@ parse_objecttype(register FILE *fp, char *name) {
  * Parses a mib file and returns a linked list of nodes found in the file.
  * Returns NULL on error.
  */
-#if !TEST
 static
-#endif
 struct node *
 parse(FILE *fp) {
     char token[64];
@@ -1061,22 +1031,6 @@ parse(FILE *fp) {
             return NULL;
         }
     }
-#if TEST
-    {
-        struct enum_list *ep;
-
-        for (np = root; np; np = np->next) {
-            printf("%s ::= { %s %d } (%d)\n", np->label, np->parent, np->subid,
-                   np->type);
-            if (np->enums) {
-                printf("Enums: \n");
-                for (ep = np->enums; ep; ep = ep->next) {
-                    printf("%s(%d)\n", ep->label, ep->value);
-                }
-            }
-        }
-    }
-#endif /* TEST */
     return root;
 }
 
index b82c621418c80d5d0b7dad326ad8d2357f87a8ac..9bc1b68f9a4e7b80fc402c94cb94248008b418d2 100644 (file)
@@ -490,10 +490,6 @@ snmp_pdu_decode(u_char * Packet,    /* data */
     u_char *bufp;
     u_char PDUType;
     u_char ASNType;
-#if UNUSED_CODE
-    int four;
-    oid objid[MAX_NAME_LEN];
-#endif
 
     bufp = asn_parse_header(Packet, Length, &PDUType);
     if (bufp == NULL)
index 76c8de80e28090a839886dcfe3521ddfac554ba0..351245e69db5329a7184edd6a79f97e31a1fe0fc 100644 (file)
 
 #include "asn1.h"
 #include "snmp.h"
-#include "snmp_vars.h"
-#if 0
-#include "mibii.h"
-#endif
 #include "snmp_api_error.h"
 #include "snmp_msg.h"
 #include "snmp_pdu.h"
+#include "snmp_vars.h"
 
 #include "util.h"
 
index ce4af263d53bae1ffb7cd63d630cf55ae8fe9a52..609fcd00482a91efe029b0b7e4f1b40adbd1cf30 100644 (file)
@@ -110,40 +110,29 @@ CacheDigest::add(const cache_key * key)
     /* hash */
     cacheDigestHashKey(this, key);
     /* turn on corresponding bits */
-#if CD_FAST_ADD
+    int on_xition_cnt = 0;
 
-    CBIT_SET(mask, hashed_keys[0]);
-    CBIT_SET(mask, hashed_keys[1]);
-    CBIT_SET(mask, hashed_keys[2]);
-    CBIT_SET(mask, hashed_keys[3]);
-#else
-
-    {
-        int on_xition_cnt = 0;
-
-        if (!CBIT_TEST(mask, hashed_keys[0])) {
-            CBIT_SET(mask, hashed_keys[0]);
-            ++on_xition_cnt;
-        }
-
-        if (!CBIT_TEST(mask, hashed_keys[1])) {
-            CBIT_SET(mask, hashed_keys[1]);
-            ++on_xition_cnt;
-        }
+    if (!CBIT_TEST(mask, hashed_keys[0])) {
+        CBIT_SET(mask, hashed_keys[0]);
+        ++on_xition_cnt;
+    }
 
-        if (!CBIT_TEST(mask, hashed_keys[2])) {
-            CBIT_SET(mask, hashed_keys[2]);
-            ++on_xition_cnt;
-        }
+    if (!CBIT_TEST(mask, hashed_keys[1])) {
+        CBIT_SET(mask, hashed_keys[1]);
+        ++on_xition_cnt;
+    }
 
-        if (!CBIT_TEST(mask, hashed_keys[3])) {
-            CBIT_SET(mask, hashed_keys[3]);
-            ++on_xition_cnt;
-        }
+    if (!CBIT_TEST(mask, hashed_keys[2])) {
+        CBIT_SET(mask, hashed_keys[2]);
+        ++on_xition_cnt;
+    }
 
-        statCounter.cd.on_xition_count.count(on_xition_cnt);
+    if (!CBIT_TEST(mask, hashed_keys[3])) {
+        CBIT_SET(mask, hashed_keys[3]);
+        ++on_xition_cnt;
     }
-#endif
+
+    statCounter.cd.on_xition_count.count(on_xition_cnt);
     ++count;
 }
 
index 2e07193579de5a8dfb4fccccbd8c2a104ac7c8a1..55b3b421300d6a508d585e6b77df5d1000b7a626 100644 (file)
@@ -190,16 +190,6 @@ ConfigParser::UnQuote(const char *token, const char **next)
                 *d = *s;
                 break;
             }
-#if 0
-        } else if (*s == '$' && quoteChar == '"') {
-            errorStr = "Unsupported cfg macro";
-            errorPos = s;
-#endif
-#if 0
-        } else if (*s == '%' && quoteChar == '"' && (!AllowMacros_ )) {
-            errorStr = "Macros are not supported here";
-            errorPos = s;
-#endif
         } else
             *d = *s;
         ++s;
index dda229da0e1b46e19952eaf7f9598607339e4834..53693396b2e853efe2b61aa4549c84d3d1300395 100644 (file)
@@ -35,15 +35,7 @@ DiskDaemonDiskIOModule::init()
      */
     assert(!initialised);
     memset(&diskd_stats, '\0', sizeof(diskd_stats));
-#if 0
-    /*
-     * DPW 2007-04-12
-     * No debugging here please because this method is called before
-     * the debug log is configured and we'll get the message on
-     * stderr when doing things like 'squid -k reconfigure'
-     */
-    debugs(47, DBG_IMPORTANT, "diskd started");
-#endif
+
     initialised = true;
 
     registerWithCacheManager();
index 2e501385db81e871667d343ffedded5a858ed3fe..3a9ce33041d813df9aba8e5996a457e6e1058d40 100644 (file)
@@ -544,10 +544,6 @@ DiskdIOStrategy::callback()
     }
 
     while (1) {
-#ifdef  ALWAYS_ZERO_BUFFERS
-        memset(&M, '\0', sizeof(M));
-#endif
-
         x = msgrcv(rmsgid, &M, diomsg::msg_snd_rcv_sz, 0, IPC_NOWAIT);
 
         if (x < 0)
index d21412491073e3d24a85806a713a3926c5b58567..5186934ac818be8313c82c1f4ba18c1f7a4ac366 100644 (file)
@@ -120,15 +120,6 @@ MemObject::~MemObject()
 
     data_hdr.freeContent();
 
-#if 0
-    /*
-     * There is no way to abort FD-less clients, so they might
-     * still have mem->clients set.
-     */
-    assert(clients.head == NULL);
-
-#endif
-
     ctx_exit(ctx);              /* must exit before we free mem->url */
 }
 
@@ -166,10 +157,6 @@ void
 MemObject::dump() const
 {
     data_hdr.dump();
-#if 0
-    /* do we want this one? */
-    debugs(20, DBG_IMPORTANT, "MemObject->data.origin_offset: " << (data_hdr.head ? data_hdr.head->nodeBuffer.offset : 0));
-#endif
 
     debugs(20, DBG_IMPORTANT, "MemObject->start_ping: " << start_ping);
     debugs(20, DBG_IMPORTANT, "MemObject->inmem_hi: " << data_hdr.endOffset());
@@ -483,19 +470,6 @@ MemObject::mostBytesAllowed() const
 
     for (dlink_node *node = clients.head; node; node = node->next) {
         store_client *sc = (store_client *) node->data;
-#if 0
-        /* This test is invalid because the client may be writing data
-         * and thus will want data immediately.
-         * If we include the test, there is a race condition when too much
-         * data is read - if all sc's are writing when a read is scheduled.
-         * XXX: fixme.
-         */
-
-        if (!sc->callbackPending())
-            /* not waiting for more data */
-            continue;
-
-#endif
 
         j = sc->delayId.bytesWanted(0, sc->copyInto.length);
 
index af201254390c9e4706e7a2ccd9a89a52efbf0b00..c9eacb81fc5b4e31b473a4adb94079ac61526be1 100644 (file)
@@ -407,63 +407,6 @@ InitConf()
     edui_conf.persist_timeout = -1;
     edui_conf.mode = 0;
     edui_conf.mode |= EDUI_MODE_INIT;
-
-    /* Set defaults from compile-time-options, if provided, but depriciated. */
-#ifdef EDUI_BASE_DN
-    xstrncpy(edui_conf.basedn, EDUI_BASE_DN, sizeof(edui_conf.basedn));
-#endif
-#ifdef EDUI_DEFAULT_HOST
-    xstrncpy(edui_conf.host, EDUI_DEFAULT_HOST, sizeof(edui_conf.host));
-#endif
-#ifdef EDUI_BIND_DN
-    xstrncpy(edui_conf.dn, EDUI_BIND_DN, sizeof(edui_conf.dn));
-#endif
-#ifdef EDUI_BIND_PASS
-    xstrncpy(edui_conf.passwd, EDUI_BIND_PASS, sizeof(edui_conf.passwd));
-#endif
-#ifdef EDUI_USER_ATTRIB
-    xstrncpy(edui_conf.attrib, EDUI_USER_ATTRIB, sizeof(edui_conf.attrib));
-#endif
-#ifdef EDUI_SEARCH_FILTER
-    xstrncpy(edui_conf.search_filter, EDUI_SEARCH_FILTER, sizeof(edui_conf.search_filter));
-#endif
-#ifdef EDUI_SEARCH_SCOPE
-    if (!strcmp(EDUI_SEARCH_SCOPE, "base"))
-        edui_conf.scope = 0;
-    else if (!strcmp(EDUI_SEARCH_SCOPE, "one"))
-        edui_conf.scope = 1;
-    else if (!strcmp(EDUI_SEARCH_SCOPE, "sub"))
-        edui_conf.scope = 2;
-    else
-        edui_conf.scope = 1;
-#endif
-#ifdef EDUI_LDAP_VERSION
-    edui_conf.ver = EDUI_LDAP_VERSION;
-#endif
-#ifdef EDUI_DEFAULT_PORT
-    edui_conf.port = EDUI_DEFAULT_PORT;
-#endif
-#ifdef EDUI_FORCE_IPV4
-    edui_conf.mode |= EDUI_MODE_IPV4;
-#endif
-#ifdef EDUI_FORCE_IPV6
-    edui_conf.mode |= EDUI_MODE_IPV6;
-#endif
-#ifdef EDUI_USE_TLS
-    edui_conf.mode |= EDUI_MODE_TLS;
-#endif
-#ifdef EDUI_USE_PERSIST
-    edui_conf.mode |= EDUI_MODE_PERSIST;
-#endif
-#ifdef EDUI_PERSIST_TIMEOUT
-    edui_conf.persist_timeout = EDUI_PERSIST_TIMEOUT;
-#endif
-#ifdef EDUI_GROUP_REQUIRED
-    edui_conf.mode |= EDUI_MODE_GROUP;
-#endif
-#ifdef EDUI_DEBUG
-    edui_conf.mode |= EDUI_MODE_DEBUG;
-#endif
 }
 
 /* Displays running configuration */
index beba3887cb849d354728dafa70a2b0b507a37132..98dd0f21d19db09db4439d702639df1aca07fb19 100644 (file)
@@ -379,16 +379,6 @@ void Adaptation::Icap::ServiceRep::noteTimeToUpdate()
     startGettingOptions();
 }
 
-#if 0
-static
-void Adaptation::Icap::ServiceRep_noteTimeToNotify(void *data)
-{
-    Adaptation::Icap::ServiceRep *service = static_cast<Adaptation::Icap::ServiceRep*>(data);
-    Must(service);
-    service->noteTimeToNotify();
-}
-#endif
-
 void Adaptation::Icap::ServiceRep::noteTimeToNotify()
 {
     Must(!notifying);
index de561d975dd2dcb2b558397a91cbe963a8ec9f36..e4e539ee4657394b737aa3457351a6a0bb677002 100644 (file)
@@ -236,20 +236,6 @@ Adaptation::Icap::Xaction::dnsLookupDone(const ipcache_addrs *ia)
     AsyncJob::Start(cs.get());
 }
 
-/*
- * This event handler is necessary to work around the no-rentry policy
- * of Adaptation::Icap::Xaction::callStart()
- */
-#if 0
-void
-Adaptation::Icap::Xaction::reusedConnection(void *data)
-{
-    debugs(93, 5, HERE << "reused connection");
-    Adaptation::Icap::Xaction *x = (Adaptation::Icap::Xaction*)data;
-    x->noteCommConnected(Comm::OK);
-}
-#endif
-
 void Adaptation::Icap::Xaction::closeConnection()
 {
     if (haveConnection()) {
index 22e8d374a6f9448ca6faeec1c0375e95f03d5977..a9c5b5970b69475a3f8683236b030959b69e5a00 100644 (file)
@@ -464,15 +464,6 @@ AnyP::Uri::parse(const HttpRequestMethod& method, const SBuf &rawUrl)
             return false;
         }
 
-#if HARDCODE_DENY_PORTS
-        /* These ports are filtered in the default squid.conf, but
-         * maybe someone wants them hardcoded... */
-        if (foundPort == 7 || foundPort == 9 || foundPort == 19) {
-            debugs(23, DBG_CRITICAL, MYNAME << "Deny access to port " << foundPort);
-            return false;
-        }
-#endif
-
         if (stringHasWhitespace(urlpath)) {
             debugs(23, 2, "URI has whitespace: {" << rawUrl << "}");
 
index bc881ef5dda39e51fc555718162088afa04307de..968e242c85e7c97a4916d4d93ac52978ed47fad9 100644 (file)
@@ -192,13 +192,6 @@ authenticateDigestNonceDelete(digest_nonce_h * nonce)
 {
     if (nonce) {
         assert(nonce->references == 0);
-#if UNREACHABLECODE
-
-        if (nonce->flags.incache)
-            hash_remove_link(digest_nonce_cache, nonce);
-
-#endif
-
         assert(!nonce->flags.incache);
 
         safe_free(nonce->key);
@@ -238,13 +231,6 @@ authenticateDigestNonceShutdown(void)
         }
     }
 
-#if DEBUGSHUTDOWN
-    if (digest_nonce_pool) {
-        delete digest_nonce_pool;
-        digest_nonce_pool = NULL;
-    }
-
-#endif
     debugs(29, 2, "Nonce cache shutdown");
 }
 
index ad1976b8695ca34850a7c939f7348c7b61e0e52b..fff0115cb1527a2b0e246899eb677b6907f5eced 100644 (file)
@@ -504,9 +504,6 @@ int nds_get_password(
 
     rc = nmasldap_get_password(ld, object_dn, pwd_len, (unsigned char *)pwd);
     if (rc == LDAP_SUCCESS) {
-#ifdef DEBUG_PASSWORD
-        DEBUG(100,("nmasldap_get_password returned %s for %s\n", pwd, object_dn));
-#endif
         DEBUG(5, ("NDS Universal Password retrieved for %s\n", object_dn));
     } else {
         DEBUG(3, ("NDS Universal Password NOT retrieved for %s\n", object_dn));
@@ -515,9 +512,6 @@ int nds_get_password(
     if (rc != LDAP_SUCCESS) {
         rc = nmasldap_get_simple_pwd(ld, object_dn, *pwd_len, pwd);
         if (rc == LDAP_SUCCESS) {
-#ifdef DEBUG_PASSWORD
-            DEBUG(100,("nmasldap_get_simple_pwd returned %s for %s\n", pwd, object_dn));
-#endif
             DEBUG(5, ("NDS Simple Password retrieved for %s\n", object_dn));
         } else {
             /* We couldn't get the password */
index ef4dec77f603b0865f440e7011d72910786ae12b..46ea3facf30f5381d9a74cd2454ec0e4fd463368 100644 (file)
@@ -3068,14 +3068,6 @@ free_time_nanoseconds(std::chrono::nanoseconds *var)
     *var = std::chrono::nanoseconds::zero();
 }
 
-#if UNUSED_CODE
-static void
-dump_size_t(StoreEntry * entry, const char *name, size_t var)
-{
-    storeAppendPrintf(entry, "%s %d\n", name, (int) var);
-}
-#endif
-
 static void
 dump_b_size_t(StoreEntry * entry, const char *name, size_t var)
 {
@@ -3088,14 +3080,6 @@ dump_b_ssize_t(StoreEntry * entry, const char *name, ssize_t var)
     storeAppendPrintf(entry, "%s %d %s\n", name, (int) var, B_BYTES_STR);
 }
 
-#if UNUSED_CODE
-static void
-dump_kb_size_t(StoreEntry * entry, const char *name, size_t var)
-{
-    storeAppendPrintf(entry, "%s %d %s\n", name, (int) var, B_KBYTES_STR);
-}
-#endif
-
 static void
 dump_b_int64_t(StoreEntry * entry, const char *name, int64_t var)
 {
@@ -3108,16 +3092,6 @@ dump_kb_int64_t(StoreEntry * entry, const char *name, int64_t var)
     storeAppendPrintf(entry, "%s %" PRId64 " %s\n", name, var, B_KBYTES_STR);
 }
 
-#if UNUSED_CODE
-static void
-parse_size_t(size_t * var)
-{
-    int i;
-    i = GetInteger();
-    *var = (size_t) i;
-}
-#endif
-
 static void
 parse_b_size_t(size_t * var)
 {
@@ -3130,14 +3104,6 @@ parse_b_ssize_t(ssize_t * var)
     parseBytesLineSigned(var, B_BYTES_STR);
 }
 
-#if UNUSED_CODE
-static void
-parse_kb_size_t(size_t * var)
-{
-    parseBytesLine(var, B_KBYTES_STR);
-}
-#endif
-
 static void
 parse_b_int64_t(int64_t * var)
 {
@@ -3235,14 +3201,6 @@ parse_wordlist(wordlist ** list)
         wordlistAdd(list, token);
 }
 
-#if 0 /* now unused */
-static int
-check_null_wordlist(wordlist * w)
-{
-    return w == NULL;
-}
-#endif
-
 static int
 check_null_acl_access(acl_access * a)
 {
index 56400a6cc0f81dc274c2843d8f0681ba097a4708..edbf86e3381d93866b8d3790f15c16ae639f3f7c 100644 (file)
@@ -14,8 +14,8 @@
 #include "CacheManager.h"
 #include "comm/Connection.h"
 #include "Debug.h"
-#include "errorpage.h"
 #include "error/ExceptionErrorDetail.h"
+#include "errorpage.h"
 #include "fde.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
@@ -487,3 +487,4 @@ CacheManager::GetInstance()
     }
     return instance;
 }
+
index 9e1cab3f93b60202fe46fc9820db7a7cf49fd10b..a59ec05fa80254605eaa94545b36a6d697462053 100644 (file)
@@ -383,11 +383,9 @@ main(int argc, char *argv[])
                     entries.back().cfgLines.push_back(buff);
                 }
                 break;
-#if 0
             case sEXIT:
                 assert(0);      /* should never get here */
                 break;
-#endif
             }
 
     }
index 586d6ba954912f523baaf1ed661a22ada8fc6d7a..69175d4dc6e94ddd402e69f308f52cdcc363c059 100644 (file)
 #include <systemd/sd-daemon.h>
 #endif
 
-#if LINGERING_CLOSE
-#define comm_close comm_lingering_close
-#endif
-
 /// dials clientListenerConnectionOpened call
 class ListeningStartedDialer: public CallDialer, public Ipc::StartListeningCb
 {
index 1512772704ef526b913050eaf457db08016872d0..5b962e0821e43592324ac86d69b2925d2fa6a525 100644 (file)
@@ -1129,38 +1129,6 @@ clientReplyContext::storeNotOKTransferDone() const
     }
 }
 
-/* A write has completed, what is the next status based on the
- * canonical request data?
- * 1 something is wrong
- * 0 nothing is wrong.
- *
- */
-int
-clientHttpRequestStatus(int fd, ClientHttpRequest const *http)
-{
-#if SIZEOF_INT64_T == 4
-    if (http->out.size > 0x7FFF0000) {
-        debugs(88, DBG_IMPORTANT, "WARNING: closing FD " << fd << " to prevent out.size counter overflow");
-        if (http->getConn())
-            debugs(88, DBG_IMPORTANT, "\tclient " << http->getConn()->peer);
-        debugs(88, DBG_IMPORTANT, "\treceived " << http->out.size << " bytes");
-        debugs(88, DBG_IMPORTANT, "\tURI " << http->log_uri);
-        return 1;
-    }
-
-    if (http->out.offset > 0x7FFF0000) {
-        debugs(88, DBG_IMPORTANT, "WARNING: closing FD " << fd < " to prevent out.offset counter overflow");
-        if (http->getConn())
-            debugs(88, DBG_IMPORTANT, "\tclient " << http->getConn()->peer);
-        debugs(88, DBG_IMPORTANT, "\treceived " << http->out.size << " bytes, offset " << http->out.offset);
-        debugs(88, DBG_IMPORTANT, "\tURI " << http->log_uri);
-        return 1;
-    }
-
-#endif
-    return 0;
-}
-
 /* Preconditions:
  * *http is a valid structure.
  * fd is either -1, or an open fd.
@@ -1284,11 +1252,6 @@ clientReplyContext::buildReplyHeader()
     HttpHeader *hdr = &reply->header;
     const bool is_hit = http->logType.isTcpHit();
     HttpRequest *request = http->request;
-#if DONT_FILTER_THESE
-    /* but you might want to if you run Squid as an HTTP accelerator */
-    /* hdr->delById(HDR_ACCEPT_RANGES); */
-    hdr->delById(HDR_ETAG);
-#endif
 
     if (is_hit || collapsedRevalidation == crSlave)
         hdr->delById(Http::HdrType::SET_COOKIE);
index 108ea935b2078fca7b54325a4af4db2c631dff9d..bd1c3e4170ff29f4b1f330651ffc215a6e96fe9a 100644 (file)
 #include "ssl/support.h"
 #endif
 
-#if LINGERING_CLOSE
-#define comm_close comm_lingering_close
-#endif
-
 static const char *const crlf = "\r\n";
 
 #if FOLLOW_X_FORWARDED_FOR
index 8eab98419da9de6f629b6582dc31d5345d19c743..55a2c63b5adf6f447e451a9004cc1e9cf2aab0bc 100644 (file)
@@ -248,7 +248,6 @@ char *clientConstructTraceEcho(ClientHttpRequest *);
 
 ACLFilledChecklist *clientAclChecklistCreate(const acl_access * acl,ClientHttpRequest * http);
 void clientAclChecklistFill(ACLFilledChecklist &, ClientHttpRequest *);
-int clientHttpRequestStatus(int fd, ClientHttpRequest const *http);
 void clientAccessCheck(ClientHttpRequest *);
 
 /* ones that should be elsewhere */
index c21b48b6926f053660d11f627689c655d73ab4fc..33d6dbfdd145f635ce9d7f0823e330372731e5a8 100644 (file)
@@ -208,9 +208,6 @@ static FTPSM ftpSendMdtm;
 static FTPSM ftpReadMdtm;
 static FTPSM ftpSendSize;
 static FTPSM ftpReadSize;
-#if 0
-static FTPSM ftpSendEPRT;
-#endif
 static FTPSM ftpReadEPRT;
 static FTPSM ftpSendPORT;
 static FTPSM ftpReadPORT;
@@ -1849,51 +1846,6 @@ ftpReadPORT(Ftp::Gateway * ftpState)
     ftpRestOrList(ftpState);
 }
 
-#if 0
-static void
-ftpSendEPRT(Ftp::Gateway * ftpState)
-{
-    /* check the server control channel is still available */
-    if (!ftpState || !ftpState->haveControlChannel("ftpSendEPRT"))
-        return;
-
-    if (Config.Ftp.epsv_all && ftpState->flags.epsv_all_sent) {
-        debugs(9, DBG_IMPORTANT, "FTP does not allow EPRT method after 'EPSV ALL' has been sent.");
-        return;
-    }
-
-    if (!Config.Ftp.eprt) {
-        /* Disabled. Switch immediately to attempting old PORT command. */
-        debugs(9, 3, "EPRT disabled by local administrator");
-        ftpSendPORT(ftpState);
-        return;
-    }
-
-    debugs(9, 3, HERE);
-    ftpState->flags.pasv_supported = 0;
-
-    ftpOpenListenSocket(ftpState, 0);
-    debugs(9, 3, "Listening for FTP data connection with FD " << ftpState->data.conn);
-    if (!Comm::IsConnOpen(ftpState->data.conn)) {
-        /* XXX Need to set error message */
-        ftpFail(ftpState);
-        return;
-    }
-
-    char buf[MAX_IPSTRLEN];
-
-    /* RFC 2428 defines EPRT as IPv6 equivalent to IPv4 PORT command. */
-    /* Which can be used by EITHER protocol. */
-    snprintf(cbuf, CTRL_BUFLEN, "EPRT |%d|%s|%d|\r\n",
-             ( ftpState->data.listenConn->local.isIPv6() ? 2 : 1 ),
-             ftpState->data.listenConn->local.toStr(buf,MAX_IPSTRLEN),
-             ftpState->data.listenConn->local.port() );
-
-    ftpState->writeCommand(cbuf);
-    ftpState->state = Ftp::Client::SENT_EPRT;
-}
-#endif
-
 static void
 ftpReadEPRT(Ftp::Gateway * ftpState)
 {
index 5bfb3f2e25fab2b0ad3268f9fc11ca06d610d5c1..5c049a91d2a45f6afe68590ae9cfdec6a01ea008 100644 (file)
@@ -748,58 +748,6 @@ commCallCloseHandlers(int fd)
     }
 }
 
-// XXX: This code has been broken, unused, and untested since 933dd09. Remove.
-#if LINGERING_CLOSE
-static void
-commLingerClose(int fd, void *unused)
-{
-    LOCAL_ARRAY(char, buf, 1024);
-    int n = FD_READ_METHOD(fd, buf, 1024);
-    if (n < 0) {
-        int xerrno = errno;
-        debugs(5, 3, "FD " << fd << " read: " << xstrerr(xerrno));
-    }
-    comm_close(fd);
-}
-
-static void
-commLingerTimeout(const FdeCbParams &params)
-{
-    debugs(5, 3, "commLingerTimeout: FD " << params.fd);
-    comm_close(params.fd);
-}
-
-/*
- * Inspired by apache
- */
-void
-comm_lingering_close(int fd)
-{
-    Security::SessionSendGoodbye(fd_table[fd].ssl);
-
-    if (shutdown(fd, 1) < 0) {
-        comm_close(fd);
-        return;
-    }
-
-    fd_note(fd, "lingering close");
-    AsyncCall::Pointer call = commCbCall(5,4, "commLingerTimeout", FdeCbPtrFun(commLingerTimeout, NULL));
-
-    debugs(5, 3, HERE << "FD " << fd << " timeout " << timeout);
-    assert(fd_table[fd].flags.open);
-    if (callback != NULL) {
-        typedef FdeCbParams Params;
-        Params &params = GetCommParams<Params>(callback);
-        params.fd = fd;
-        fd_table[fd].timeoutHandler = callback;
-        fd_table[fd].timeout = squid_curtime + static_cast<time_t>(10);
-    }
-
-    Comm::SetSelect(fd, COMM_SELECT_READ, commLingerClose, NULL, 0);
-}
-
-#endif
-
 /**
  * enable linger with time of 0 so that when the socket is
  * closed, TCP generates a RESET
index c963e1ca3910e1e8f93c7674304a9ebdf4f4c854..2e9dea96faef217f75346cf93c9874e0a987856e 100644 (file)
@@ -28,9 +28,6 @@ void _comm_close(int fd, char const *file, int line);
 #define comm_close(x) (_comm_close((x), __FILE__, __LINE__))
 void old_comm_reset_close(int fd);
 void comm_reset_close(const Comm::ConnectionPointer &conn);
-#if LINGERING_CLOSE
-void comm_lingering_close(int fd);
-#endif
 
 int comm_connect_addr(int sock, const Ip::Address &addr);
 void comm_init(void);
index e5d6c4fe979937b74449db6b04bd6446b4b77af0..5fb821816d4035b24ec6a17fb19fffaf3bd0036d 100644 (file)
@@ -317,7 +317,6 @@ comm_select_tcp_incoming(void)
     statCounter.comm_tcp_incoming.count(nevents);
 }
 
-#define DEBUG_FDBITS 0
 /* Select on all sockets; call handlers for those that are ready. */
 Comm::Flag
 Comm::DoSelect(int msec)
@@ -335,11 +334,6 @@ Comm::DoSelect(int msec)
     int maxindex;
     unsigned int k;
     int j;
-#if DEBUG_FDBITS
-
-    int i;
-#endif
-
     fd_mask *fdsp;
     fd_mask *pfdsp;
     fd_mask tmask;
@@ -399,20 +393,6 @@ Comm::DoSelect(int msec)
             }
         }
 
-#if DEBUG_FDBITS
-        for (i = 0; i < maxfd; ++i) {
-            /* Check each open socket for a handler. */
-
-            if (fd_table[i].read_handler) {
-                assert(FD_ISSET(i, &readfds));
-            }
-
-            if (fd_table[i].write_handler) {
-                assert(FD_ISSET(i, &writefds));
-            }
-        }
-
-#endif
         if (nreadfds + nwritefds == 0) {
             assert(shutting_down);
             return Comm::SHUTDOWN;
@@ -482,14 +462,6 @@ Comm::DoSelect(int msec)
 
                 EBIT_CLR(tmask, k); /* this will be done */
 
-#if DEBUG_FDBITS
-
-                debugs(5, 9, "FD " << fd << " bit set for reading");
-
-                assert(FD_ISSET(fd, &readfds));
-
-#endif
-
                 if (fdIsUdpListener(fd)) {
                     calludp = 1;
                     continue;
@@ -546,14 +518,6 @@ Comm::DoSelect(int msec)
 
                 EBIT_CLR(tmask, k); /* this will be done */
 
-#if DEBUG_FDBITS
-
-                debugs(5, 9, "FD " << fd << " bit set for writing");
-
-                assert(FD_ISSET(fd, &writefds));
-
-#endif
-
                 if (fdIsUdpListener(fd)) {
                     calludp = 1;
                     continue;
index 0432b7948add971802850bf579458ec72a807be4..92c42d06ab9498d4c43d9dbd0f9da1851bac518a 100644 (file)
@@ -311,7 +311,6 @@ comm_select_tcp_incoming(void)
     statCounter.comm_tcp_incoming.count(nevents);
 }
 
-#define DEBUG_FDBITS 0
 /* Select on all sockets; call handlers for those that are ready. */
 Comm::Flag
 Comm::DoSelect(int msec)
@@ -327,10 +326,6 @@ Comm::DoSelect(int msec)
     int pending;
     int calldns = 0, calludp = 0, calltcp = 0;
     int j;
-#if DEBUG_FDBITS
-
-    int i;
-#endif
     struct timeval poll_time;
     double timeout = current_dtime + (msec / 1000.0);
     fde *F;
@@ -390,20 +385,6 @@ Comm::DoSelect(int msec)
             }
         }
 
-#if DEBUG_FDBITS
-        for (i = 0; i < maxfd; ++i) {
-            /* Check each open socket for a handler. */
-
-            if (fd_table[i].read_handler) {
-                assert(FD_ISSET(i, readfds));
-            }
-
-            if (fd_table[i].write_handler) {
-                assert(FD_ISSET(i, writefds));
-            }
-        }
-
-#endif
         if (nreadfds + nwritefds == 0) {
             assert(shutting_down);
             return Comm::SHUTDOWN;
@@ -475,14 +456,6 @@ Comm::DoSelect(int msec)
             if (no_bits)
                 continue;
 
-#if DEBUG_FDBITS
-
-            debugs(5, 9, "FD " << fd << " bit set for reading");
-
-            assert(FD_ISSET(fd, readfds));
-
-#endif
-
             if (fdIsUdpListener(fd)) {
                 calludp = 1;
                 continue;
@@ -558,14 +531,6 @@ Comm::DoSelect(int msec)
             if (no_bits)
                 continue;
 
-#if DEBUG_FDBITS
-
-            debugs(5, 9, "FD " << fd << " bit set for writing");
-
-            assert(FD_ISSET(fd, writefds));
-
-#endif
-
             if (fdIsUdpListener(fd)) {
                 calludp = 1;
                 continue;
index a7ccc3a2e97b0eb72a18b738208c98323aa0ef82..af877a29197271c2573d57b290727c9df740a6d4 100644 (file)
@@ -182,19 +182,6 @@ Comm::TcpAcceptor::setListen()
 #endif
     }
 
-#if 0
-    // Untested code.
-    // Set TOS if needed.
-    // To correctly implement TOS values on listening sockets, probably requires
-    // more work to inherit TOS values to created connection objects.
-    if (conn->tos)
-        Ip::Qos::setSockTos(conn, conn->tos)
-#if SO_MARK
-        if (conn->nfmark)
-            Ip::Qos::setSockNfmark(conn, conn->nfmark);
-#endif
-#endif
-
     typedef CommCbMemFunT<Comm::TcpAcceptor, CommCloseCbParams> Dialer;
     closer_ = JobCallback(5, 4, Dialer, this, Comm::TcpAcceptor::handleClosure);
     comm_add_close_handler(conn->fd, closer_);
index 6b96975b172ebab081eee27c0571db0c6c1e20e9..aaf2df9b493154cd0017ecf7aed9b3e53979160f 100644 (file)
@@ -413,9 +413,6 @@ rfc1035RRUnpack(const char *buf, size_t sz, unsigned int *off, rfc1035_rr * RR)
     }
     RR->rdlength = rdlength;
     switch (RR->type) {
-#if DNS_CNAME
-    case RFC1035_TYPE_CNAME:
-#endif
     case RFC1035_TYPE_PTR:
         RR->rdata = (char*)xmalloc(RFC1035_MAXHOSTNAMESZ);
         rdata_off = *off;
@@ -749,94 +746,3 @@ rfc1035SetQueryID(char *buf, unsigned short qid)
     memcpy(buf, &s, sizeof(s));
 }
 
-#if DRIVER
-#include <sys/socket.h>
-int
-main(int argc, char *argv[])
-{
-    char input[SQUID_DNS_BUFSZ];
-    char buf[SQUID_DNS_BUFSZ];
-    char rbuf[SQUID_DNS_BUFSZ];
-    size_t sz = SQUID_DNS_BUFSZ;
-    unsigned short sid;
-    int s;
-    int rl;
-    struct sockaddr_in S;
-    if (3 != argc) {
-        fprintf(stderr, "usage: %s ip port\n", argv[0]);
-        exit(EXIT_FAILURE);
-    }
-    setbuf(stdout, NULL);
-    setbuf(stderr, NULL);
-    s = socket(PF_INET, SOCK_DGRAM, 0);
-    if (s < 0) {
-        perror("socket");
-        exit(EXIT_FAILURE);
-    }
-    memset(&S, '\0', sizeof(S));
-    S.sin_family = AF_INET;
-    S.sin_port = htons(atoi(argv[2]));
-    S.sin_addr.s_addr = inet_addr(argv[1]);
-    while (fgets(input, RFC1035_DEFAULT_PACKET_SZ, stdin)) {
-        struct in_addr junk;
-        strtok(input, "\r\n");
-        memset(buf, '\0', RFC1035_DEFAULT_PACKET_SZ);
-        sz = RFC1035_DEFAULT_PACKET_SZ;
-        if (inet_pton(AF_INET, input, &junk)) {
-            sid = rfc1035BuildPTRQuery(junk, buf, &sz);
-        } else {
-            sid = rfc1035BuildAQuery(input, buf, &sz);
-        }
-        sendto(s, buf, sz, 0, (struct sockaddr *) &S, sizeof(S));
-        do {
-            fd_set R;
-            struct timeval to;
-            FD_ZERO(&R);
-            FD_SET(s, &R);
-            to.tv_sec = 10;
-            to.tv_usec = 0;
-            rl = select(s + 1, &R, NULL, NULL, &to);
-        } while (0);
-        if (rl < 1) {
-            printf("TIMEOUT\n");
-            continue;
-        }
-        memset(rbuf, '\0', RFC1035_DEFAULT_PACKET_SZ);
-        rl = recv(s, rbuf, RFC1035_DEFAULT_PACKET_SZ, 0);
-        {
-            unsigned short rid = 0;
-            int i;
-            int n;
-            rfc1035_rr *answers = NULL;
-            n = rfc1035AnswersUnpack(rbuf,
-                                     rl,
-                                     &answers,
-                                     &rid);
-            if (n < 0) {
-                printf("ERROR %d\n", -n);
-            } else if (rid != sid) {
-                printf("ERROR, ID mismatch (%#hx, %#hx)\n", sid, rid);
-            } else {
-                printf("%d answers\n", n);
-                for (i = 0; i < n; i++) {
-                    if (answers[i].type == RFC1035_TYPE_A) {
-                        struct in_addr a;
-                        char ipa_str[sizeof(a)];
-                        memcpy(&a, answers[i].rdata, 4);
-                        printf("A\t%d\t%s\n", answers[i].ttl, inet_ntop(AF_INET,&a,tmp,sizeof(a)));
-                    } else if (answers[i].type == RFC1035_TYPE_PTR) {
-                        char ptr[128];
-                        strncpy(ptr, answers[i].rdata, answers[i].rdlength);
-                        printf("PTR\t%d\t%s\n", answers[i].ttl, ptr);
-                    } else {
-                        fprintf(stderr, "can't print answer type %d\n",
-                                (int) answers[i].type);
-                    }
-                }
-            }
-        }
-    }
-    return EXIT_SUCCESS;
-}
-#endif
-
index cba4445d17907c7d07d30471f01f618d57f1f2f6..68ef11970efd8ed7e7a209e3d63142bafbf52083 100644 (file)
@@ -157,181 +157,3 @@ rfc3596BuildPTRQuery6(const struct in6_addr addr, char *buf, size_t sz, unsigned
     return rfc3596BuildHostQuery(rev, buf, sz, qid, query, RFC1035_TYPE_PTR, edns_sz);
 }
 
-#if DRIVER
-
-/* driver needs the rfc1035 code _without_ the main() */
-#  define main(a,b) rfc1035_main(a,b)
-#  include "rfc1035.c"
-#  undef main(a,b)
-
-#include <sys/socket.h>
-
-int
-main(int argc, char *argv[])
-{
-#define PACKET_BUFSZ        1024
-    char input[PACKET_BUFSZ];
-    char buf[PACKET_BUFSZ];
-    char rbuf[PACKET_BUFSZ];
-    size_t sz = PACKET_BUFSZ;
-    unsigned short sid, sidb;
-    int s;
-    int rl;
-    ssize_t edns_max = -1;
-
-    struct sockaddr* S;
-    int var = 1;
-
-    if ( argc < 3 || argc > 4) {
-        fprintf(stderr, "usage: %s [-6|-4] ip port\n", argv[0]);
-        exit(EXIT_FAILURE);
-    }
-
-    setbuf(stdout, NULL);
-    setbuf(stderr, NULL);
-
-    if (argv[var][0] == '-') {
-        if (argv[var][1] == '4')
-            prefer = AF_INET;
-        else if (argv[var][1] == '6')
-            prefer = AF_INET6;
-        else if (argv[var][1] == 'E')
-            edns_max = atoi(argv[var++]);
-        else {
-            fprintf(stderr, "usage: %s [-6|-4] [-E packet-size] ip port\n", argv[0]);
-            fprintf(stderr, "  EDNS packets my be up to %d\n", PACKET_BUFSZ);
-            exit(EXIT_FAILURE);
-        }
-
-        var++;
-    }
-
-    s = socket(PF_INET, SOCK_DGRAM, 0);
-
-    if (s < 0) {
-        perror("socket");
-        exit(EXIT_FAILURE);
-    }
-
-    memset(&S, '\0', sizeof(S));
-
-    if (prefer == 6) {
-        S = (struct sockaddr *) new sockaddr_in6;
-        memset(S,0,sizeof(struct sockaddr_in6));
-
-        ((struct sockaddr_in6 *)S)->sin6_family = AF_INET6;
-        ((struct sockaddr_in6 *)S)->sin6_port = htons(atoi(argv[var+1]));
-
-        if ( ! inet_pton(AF_INET6, argv[var], &((struct sockaddr_in6 *)S)->sin6_addr.s_addr) ) {
-            perror("listen address");
-            exit(EXIT_FAILURE);
-        }
-
-        s = socket(PF_INET6, SOCK_DGRAM, 0);
-    } else {
-        S = (struct sockaddr *) new sockaddr_in;
-        memset(S,0,sizeof(struct sockaddr_in));
-
-        ((struct sockaddr_in *)S)->sin_family = AF_INET;
-        ((struct sockaddr_in *)S)->sin_port = htons(atoi(argv[var+1]));
-
-        if ( ! inet_pton(AF_INET, argv[var], &((struct sockaddr_in *)S)->sin_addr.s_addr) ) {
-            perror("listen address");
-            exit(EXIT_FAILURE);
-        }
-    }
-
-    while (fgets(input, PACKET_BUFSZ, stdin))
-    {
-
-        struct in6_addr junk6;
-
-        struct in_addr junk4;
-        strtok(input, "\r\n");
-        memset(buf, '\0', PACKET_BUFSZ);
-        sz = PACKET_BUFSZ;
-
-        if (inet_pton(AF_INET6, input, &junk6)) {
-            sid = rfc1035BuildPTRQuery6(junk6, buf, &sz, edns_max);
-            sidb=0;
-        } else if (inet_pton(AF_INET, input, &junk4)) {
-            sid = rfc1035BuildPTRQuery4(junk4, buf, &sz, edns_max);
-            sidb=0;
-        } else {
-            sid = rfc1035BuildAAAAQuery(input, buf, &sz, edns_max);
-            sidb = rfc1035BuildAQuery(input, buf, &sz, edns_max);
-        }
-
-        sendto(s, buf, sz, 0, S, sizeof(*S));
-
-        do {
-            fd_set R;
-
-            struct timeval to;
-            FD_ZERO(&R);
-            FD_SET(s, &R);
-            to.tv_sec = 10;
-            to.tv_usec = 0;
-            rl = select(s + 1, &R, NULL, NULL, &to);
-        } while (0);
-
-        if (rl < 1) {
-            printf("TIMEOUT\n");
-            continue;
-        }
-
-        memset(rbuf, '\0', PACKET_BUFSZ);
-        rl = recv(s, rbuf, PACKET_BUFSZ, 0);
-        {
-            unsigned short rid = 0;
-            int i;
-            int n;
-            rfc1035_rr *answers = NULL;
-            n = rfc1035AnswersUnpack(rbuf,
-                                     rl,
-                                     &answers,
-                                     &rid);
-
-            if (n < 0) {
-                printf("ERROR %d\n", -n);
-            } else if (rid != sid && rid != sidb) {
-                printf("ERROR, ID mismatch (%#hx, %#hx)\n", sid, rid);
-                printf("ERROR, ID mismatch (%#hx, %#hx)\n", sidb, rid);
-            } else {
-                printf("%d answers\n", n);
-
-                for (i = 0; i < n; i++) {
-                    if (answers[i].type == RFC1035_TYPE_A) {
-
-                        struct in_addr a;
-                        char tmp[16];
-                        memcpy(&a, answers[i].rdata, 4);
-                        printf("A\t%d\t%s\n", answers[i].ttl, inet_ntop(AF_INET,&a,tmp,16));
-                    } else if (answers[i].type == RFC1035_TYPE_AAAA) {
-
-                        struct in6_addr a;
-                        char tmp[INET6_ADDRSTRLEN];
-                        memcpy(&a, answers[i].rdata, 16);
-                        printf("AAAA\t%d\t%s\n", answers[i].ttl, inet_ntop(AF_INET6,&a,tmp,sizeof(tmp)));
-                    } else if (answers[i].type == RFC1035_TYPE_PTR) {
-                        char ptr[RFC1035_MAXHOSTNAMESZ];
-                        strncpy(ptr, answers[i].rdata, answers[i].rdlength);
-                        printf("PTR\t%d\t%s\n", answers[i].ttl, ptr);
-                    } else if (answers[i].type == RFC1035_TYPE_CNAME) {
-                        char ptr[RFC1035_MAXHOSTNAMESZ];
-                        strncpy(ptr, answers[i].rdata, answers[i].rdlength);
-                        printf("CNAME\t%d\t%s\n", answers[i].ttl, ptr);
-                    } else {
-                        fprintf(stderr, "can't print answer type %d\n",
-                                (int) answers[i].type);
-                    }
-                }
-            }
-        }
-    }
-
-    return EXIT_SUCCESS;
-}
-
-#endif
-
index ecb70b9f333518e07d4fb6e69e5eeef509384302..3aa2ef94cc7d96e03bcba4c432470cfd1464c945 100644 (file)
@@ -551,16 +551,6 @@ ESIContext::send ()
     } else
         flags.oktosend = 1;
 
-#if 0
-
-    if (!flags.oktosend) {
-
-        fatal("ESIContext::send: Not OK to send.\n");
-        return 0;
-    }
-
-#endif
-
     if (!(rep || (outbound.getRaw() &&
                   outbound->len && (outbound_offset <= outbound->len)))) {
         debugs(86, 5, "ESIContext::send: Nothing to send.");
index 2c6fc11d44fd583cd1886141f30379943843983e..ce9b380d3e1299823b148651975d540b45bc7ec2 100644 (file)
@@ -135,17 +135,6 @@ esiBufferRecipient (clientStreamNode *node, ClientHttpRequest *http, HttpReply *
         return;
     }
 
-    /* after the write to the user occurs, (ie here, or in a callback)
-     * we call */
-    if (clientHttpRequestStatus(-1, http)) {
-        /* TODO: Does thisNode if block leak htto ? */
-        /* XXX when reviewing ESI this is the first place to look */
-        node->data = NULL;
-        esiStream->finished = 1;
-        esiStream->include->includeFail (esiStream);
-        return;
-    };
-
     switch (clientStreamStatus (node, http)) {
 
     case STREAM_UNPLANNED_COMPLETE: /* fallthru ok */
index 5e56df1fbd8fff64a62b4d62bd2e7c611cabd767..f3afd2aafea5e9bd179483065ac19a23493ffac2 100644 (file)
@@ -103,47 +103,6 @@ Fs::Ufs::UFSSwapLogParser::GetUFSSwapLogParser(FILE *fp)
                "index corruption. Forcing a full cache index rebuild. " <<
                "See Squid bug #3441.");
         return NULL;
-
-#if UNUSED_CODE
-        // baseline
-        // 32-bit sfileno
-        // native time_t (hopefully 64-bit)
-        // 64-bit file size
-        if (header.record_size == sizeof(StoreSwapLogData)) {
-            debugs(47, DBG_IMPORTANT, "Version 1 of swap file with LFS support detected... ");
-            return new UFSSwapLogParser_v1(fp);
-        }
-
-        // which means we have a 3-way grid of permutations to import (yuck!)
-        // 1) sfileno 32-bit / 64-bit  (64-bit was broken)
-        // 2) time_t 32-bit / 64-bit
-        // 3) size_t 32-bit / 64-bit  (32-bit was pre-LFS)
-
-        // 32-bit systems...
-        // only LFS (size_t) differs from baseline
-        if (header.record_size == sizeof(struct UFSSwapLogParser_v1_32bs::StoreSwapLogDataOld)) {
-            debugs(47, DBG_IMPORTANT, "Version 1 (32-bit) swap file without LFS support detected... ");
-            return new UFSSwapLogParser_v1_32bs(fp);
-        }
-        // LFS (size_t) and timestamps (time_t) differs from baseline
-        if (header.record_size == sizeof(struct UFSSwapLogParser_v1_32bst::StoreSwapLogDataOld)) {
-            debugs(47, DBG_IMPORTANT, "Version 1 (32-bit) swap file with short timestamps and without LFS support detected... ");
-            return new UFSSwapLogParser_v1_32bst(fp);
-        }
-        // No downgrade for 64-bit timestamps to 32-bit.
-
-        // 64-bit systems
-        // sfileno was 64-bit for a some builds
-        if (header.record_size == sizeof(struct UFSSwapLogParser_v1_64bfn::StoreSwapLogDataOld)) {
-            debugs(47, DBG_IMPORTANT, "Version 1 (64-bit) swap file with broken sfileno detected... ");
-            return new UFSSwapLogParser_v1_64bfn(fp);
-        }
-        // NP: 64-bit system with 32-bit size_t/time_t are not handled.
-
-        debugs(47, DBG_IMPORTANT, "WARNING: The swap file has wrong format!... ");
-        debugs(47, DBG_IMPORTANT, "NOTE: Cannot safely downgrade caches to short (32-bit) timestamps.");
-        return NULL;
-#endif
     }
 
     if (header.version >= 2) {
index fd9aa8d843b5380bf096a9ee65eb71e96a431966..fdd6f358a901ec1e1ebe54e4ca371a7f033b2041 100644 (file)
@@ -109,12 +109,6 @@ file_close(int fd)
      */
     assert(F->write_handler == NULL);
 
-#if CALL_FSYNC_BEFORE_CLOSE
-
-    fsync(fd);
-
-#endif
-
     close(fd);
 
     debugs(6, F->flags.close_request ? 2 : 5, "file_close: FD " << fd << " really closing");
index 20e111ba2f972bad33674b22d347fee3182e049d..6c0f19005fcfd91f04a09d8df5504b8d09f49ab2 100644 (file)
@@ -226,16 +226,6 @@ httpMaybeRemovePublic(StoreEntry * e, Http::StatusCode status)
 #endif
 
     default:
-#if QUESTIONABLE
-        /*
-         * Any 2xx response should eject previously cached entities...
-         */
-
-        if (status >= 200 && status < 300)
-            remove = 1;
-
-#endif
-
         break;
     }
 
@@ -1985,12 +1975,6 @@ HttpStateData::httpBuildRequestHeader(HttpRequest * request,
         if (!cc)
             cc = new HttpHdrCc();
 
-#if 0 /* see bug 2330 */
-        /* Set no-cache if determined needed but not found */
-        if (request->flags.nocache)
-            EBIT_SET(cc->mask, HttpHdrCcType::CC_NO_CACHE);
-#endif
-
         /* Add max-age only without no-cache */
         if (!cc->hasMaxAge() && !cc->hasNoCache()) {
             // XXX: performance regression. c_str() reallocates
index 5cf04d3cdf8058b1293a6f053f1234763f57c84b..edd9b8efad3d9a1e462332893fad468469530100 100644 (file)
@@ -364,7 +364,7 @@ static const class HeaderTableRecord HttpHeaderDefinitionsTable[] =
 };
 
 const class HeaderTableRecord *
-HttpHeaderHashTable::lookup (const char *str, size_t len)
+    HttpHeaderHashTable::lookup (const char *str, size_t len)
 {
     if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     {
index 25b8a9befb7eec732d7e0ce356ab1f99374468bb..5f50e8bc9491cdc0cf2c31ffda2315e1c936ab5a 100644 (file)
@@ -73,12 +73,6 @@ Http::Stream::writeComplete(size_t size)
 
     http->out.size += size;
 
-    if (clientHttpRequestStatus(clientConnection->fd, http)) {
-        initiateClose("failure or true request status");
-        /* Do we leak here ? */
-        return;
-    }
-
     switch (socketState()) {
 
     case STREAM_NONE:
index 446de388d1a8fa9bb76744fbce7ed636bc94eaae..5a0cc446a759893b004191be5dea1f00acb52cdd 100644 (file)
@@ -44,6 +44,7 @@ logfile_mod_udp_write(Logfile * lf, const char *buf, size_t len)
     s = write(ll->fd, (char const *) buf, len);
     fd_bytes(ll->fd, s, FD_WRITE);
 #if 0
+    // TODO: Enable after polishing to properly log these errors.
     if (s < 0) {
         int xerrno = errno;
         debugs(1, DBG_IMPORTANT, "logfile (udp): got errno (" << errno << "):" << xstrerr(xerrno));
index 86060746f15c1b845f360ad97c2a00b8a0101d9a..0155e558b63c656c3924123a2b808679f70d607b 100644 (file)
@@ -419,17 +419,6 @@ memConfigure(void)
         new_pool_limit = -1;
     }
 
-#if 0
-    /** \par
-     * DPW 2007-04-12
-     * No debugging here please because this method is called before
-     * the debug log is configured and we'll get the message on
-     * stderr when doing things like 'squid -k reconfigure'
-     */
-    if (MemPools::GetInstance().idleLimit() > new_pool_limit)
-        debugs(13, DBG_IMPORTANT, "Shrinking idle mem pools to "<< std::setprecision(3) << toMB(new_pool_limit) << " MB");
-#endif
-
     MemPools::GetInstance().setIdleLimit(new_pool_limit);
 }
 
@@ -692,17 +681,6 @@ MemPoolReportSorter(const void *a, const void *b)
     if (pb > pa)
         return 1;
 
-#if 0
-    // use this to sort on In Use high(hrs)
-    //
-    if (A->meter->inuse.peakTime() > B->meter->inuse.peakTime())
-        return -1;
-
-    if (B->meter->inuse.peakTime() > A->meter->inuse.peakTime())
-        return 1;
-
-#endif
-
     return 0;
 }
 
index a53dee1c72a531f178ad32b56676ffc5aed3c5db..7e79943876ae0c39b882f71fe22b78d94e30bb87 100644 (file)
@@ -157,3 +157,4 @@ Mgr::QueryParams::CreateParam(QueryParam::Type aType)
     }
     return NULL;
 }
+
index dfa2d8cfadf663412991f25303958cb7858a9cb4..4ad35f09f1af8525694c5b7683367b2cfae0817b 100644 (file)
@@ -185,25 +185,6 @@ peerDigestNeeded(PeerDigest * pd)
     peerDigestSetCheck(pd, 0);  /* check asap */
 }
 
-/* currently we do not have a reason to disable without destroying */
-#if FUTURE_CODE
-/* disables peer for good */
-static void
-peerDigestDisable(PeerDigest * pd)
-{
-    debugs(72, 2, "peerDigestDisable: peer " << pd->host.buf() << " disabled for good");
-    pd->times.disabled = squid_curtime;
-    pd->times.next_check = -1;  /* never */
-    pd->flags.usable = 0;
-
-    delete pd->cd
-    pd->cd = nullptr;
-
-    /* we do not destroy the pd itself to preserve its "history" and stats */
-}
-
-#endif
-
 /* increment retry delay [after an unsuccessful attempt] */
 static time_t
 peerDigestIncDelay(const PeerDigest * pd)
@@ -727,14 +708,6 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const
     if (!reason) {
         if (!(pd = fetch->pd))
             reason = "peer digest disappeared?!";
-
-#if DONT            /* WHY NOT? /HNO */
-
-        else if (!cbdataReferenceValid(pd))
-            reason = "invalidated peer digest?!";
-
-#endif
-
         else
             host = pd->host;
     }
index 2b5d5a92e475fbda4ae89ce23221b1091c593629..f35971d83daad67f2208a4fbe72f088d5651b8e5 100644 (file)
@@ -174,15 +174,8 @@ SBuf::rawSpace(size_type minSpace)
 void
 SBuf::clear()
 {
-#if 0
-    //enabling this code path, the store will be freed and reinitialized
-    store_ = GetStorePrototype(); //uncomment to actually free storage upon clear()
-#else
-    //enabling this code path, we try to release the store without deallocating it.
-    // will be lazily reallocated if needed.
     if (store_->LockCount() == 1)
         store_->clear();
-#endif
     len_ = 0;
     off_ = 0;
     ++stats.clear;
index ebb1ebb45719a09add2d48fee4df22598737e681..052d6cb148256d6675e8735f7d6d713fa34e666c 100644 (file)
@@ -35,13 +35,6 @@ tls_read_method(int fd, char *buf, int len)
     auto session = fd_table[fd].ssl.get();
     debugs(83, 3, "started for session=" << (void*)session);
 
-#if DONT_DO_THIS && USE_OPENSSL
-    if (!SSL_is_init_finished(session)) {
-        errno = ENOTCONN;
-        return -1;
-    }
-#endif
-
 #if USE_OPENSSL
     int i = SSL_read(session, buf, len);
 #elif USE_GNUTLS
index e010656e9f253a1fac3c1e942e54267b85823647..26633b1a123155ba1db35910e992a325520f227e 100644 (file)
@@ -63,8 +63,6 @@
 #include "comm.h"
 #include "StoreSearch.h"
 
-#define DEBUG_OPENFD 1
-
 typedef int STOBJFLT(const StoreEntry *);
 
 class StatObjectsState
@@ -89,9 +87,7 @@ static void statStoreEntry(MemBuf * mb, StoreEntry * e);
 static double statCPUUsage(int minutes);
 static OBJH stat_objects_get;
 static OBJH stat_vmobjects_get;
-#if DEBUG_OPENFD
 static OBJH statOpenfdObj;
-#endif
 static EVH statObjects;
 static OBJH statCountersDump;
 static OBJH statPeerSelect;
@@ -419,7 +415,6 @@ stat_vmobjects_get(StoreEntry * sentry)
     statObjectsStart(sentry, statObjectsVmFilter);
 }
 
-#if DEBUG_OPENFD
 static int
 statObjectsOpenfdFilter(const StoreEntry * e)
 {
@@ -438,8 +433,6 @@ statOpenfdObj(StoreEntry * sentry)
     statObjectsStart(sentry, statObjectsOpenfdFilter);
 }
 
-#endif
-
 #if XMALLOC_STATISTICS
 static void
 info_get_mallstat(int size, int number, int oldnum, void *data)
@@ -1222,10 +1215,8 @@ statRegisterWithCacheManager(void)
                         "Active Cached Usernames",
                         Auth::User::CredentialsCacheStats, 0, 1);
 #endif
-#if DEBUG_OPENFD
     Mgr::RegisterAction("openfd_objects", "Objects with Swapout files open",
                         statOpenfdObj, 0, 0);
-#endif
 #if STAT_GRAPHS
     Mgr::RegisterAction("graph_variables", "Display cache metrics graphically",
                         statGraphDump, 0, 1);
index f8e9ba0d1b69218784e6b25d98f608c038c390ec..aefc66c46ad6667e6dfa7cc8e2d90f8a4f178abf 100644 (file)
@@ -606,12 +606,6 @@ StoreEntry::setPublicKey(const KeyScope scope)
      *
      * If RELEASE_REQUEST is set, setPublicKey() should not be called.
      */
-#if MORE_DEBUG_OUTPUT
-
-    if (EBIT_TEST(flags, RELEASE_REQUEST))
-        debugs(20, DBG_IMPORTANT, "assertion failed: RELEASE key " << key << ", url " << mem_obj->url);
-
-#endif
 
     assert(!EBIT_TEST(flags, RELEASE_REQUEST));
 
@@ -895,7 +889,6 @@ storeAppendVPrintf(StoreEntry * e, const char *fmt, va_list vargs)
 struct _store_check_cachable_hist {
 
     struct {
-        int non_get;
         int not_entry_cachable;
         int wrong_content_length;
         int too_big;
@@ -967,46 +960,39 @@ StoreEntry::checkCachable()
         return 0; // avoid rerequesting release below
     }
 
-#if CACHE_ALL_METHODS
-
-    if (mem_obj->method != Http::METHOD_GET) {
-        debugs(20, 2, "StoreEntry::checkCachable: NO: non-GET method");
-        ++store_check_cachable_hist.no.non_get;
-    } else
-#endif
-        if (store_status == STORE_OK && EBIT_TEST(flags, ENTRY_BAD_LENGTH)) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: wrong content-length");
-            ++store_check_cachable_hist.no.wrong_content_length;
-        } else if (!mem_obj) {
-            // XXX: In bug 4131, we forgetHit() without mem_obj, so we need
-            // this segfault protection, but how can we get such a HIT?
-            debugs(20, 2, "StoreEntry::checkCachable: NO: missing parts: " << *this);
-            ++store_check_cachable_hist.no.missing_parts;
-        } else if (checkTooBig()) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: too big");
-            ++store_check_cachable_hist.no.too_big;
-        } else if (checkTooSmall()) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: too small");
-            ++store_check_cachable_hist.no.too_small;
-        } else if (EBIT_TEST(flags, KEY_PRIVATE)) {
-            debugs(20, 3, "StoreEntry::checkCachable: NO: private key");
-            ++store_check_cachable_hist.no.private_key;
-        } else if (hasDisk()) {
-            /*
-             * the remaining cases are only relevant if we haven't
-             * started swapping out the object yet.
-             */
-            return 1;
-        } else if (storeTooManyDiskFilesOpen()) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: too many disk files open");
-            ++store_check_cachable_hist.no.too_many_open_files;
-        } else if (fdNFree() < RESERVED_FD) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: too many FD's open");
-            ++store_check_cachable_hist.no.too_many_open_fds;
-        } else {
-            ++store_check_cachable_hist.yes.Default;
-            return 1;
-        }
+    if (store_status == STORE_OK && EBIT_TEST(flags, ENTRY_BAD_LENGTH)) {
+        debugs(20, 2, "StoreEntry::checkCachable: NO: wrong content-length");
+        ++store_check_cachable_hist.no.wrong_content_length;
+    } else if (!mem_obj) {
+        // XXX: In bug 4131, we forgetHit() without mem_obj, so we need
+        // this segfault protection, but how can we get such a HIT?
+        debugs(20, 2, "StoreEntry::checkCachable: NO: missing parts: " << *this);
+        ++store_check_cachable_hist.no.missing_parts;
+    } else if (checkTooBig()) {
+        debugs(20, 2, "StoreEntry::checkCachable: NO: too big");
+        ++store_check_cachable_hist.no.too_big;
+    } else if (checkTooSmall()) {
+        debugs(20, 2, "StoreEntry::checkCachable: NO: too small");
+        ++store_check_cachable_hist.no.too_small;
+    } else if (EBIT_TEST(flags, KEY_PRIVATE)) {
+        debugs(20, 3, "StoreEntry::checkCachable: NO: private key");
+        ++store_check_cachable_hist.no.private_key;
+    } else if (hasDisk()) {
+        /*
+            * the remaining cases are only relevant if we haven't
+            * started swapping out the object yet.
+            */
+        return 1;
+    } else if (storeTooManyDiskFilesOpen()) {
+        debugs(20, 2, "StoreEntry::checkCachable: NO: too many disk files open");
+        ++store_check_cachable_hist.no.too_many_open_files;
+    } else if (fdNFree() < RESERVED_FD) {
+        debugs(20, 2, "StoreEntry::checkCachable: NO: too many FD's open");
+        ++store_check_cachable_hist.no.too_many_open_fds;
+    } else {
+        ++store_check_cachable_hist.yes.Default;
+        return 1;
+    }
 
     releaseRequest();
     return 0;
@@ -1016,13 +1002,6 @@ void
 storeCheckCachableStats(StoreEntry *sentry)
 {
     storeAppendPrintf(sentry, "Category\t Count\n");
-
-#if CACHE_ALL_METHODS
-
-    storeAppendPrintf(sentry, "no.non_get\t%d\n",
-                      store_check_cachable_hist.no.non_get);
-#endif
-
     storeAppendPrintf(sentry, "no.not_entry_cachable\t%d\n",
                       store_check_cachable_hist.no.not_entry_cachable);
     storeAppendPrintf(sentry, "no.wrong_content_length\t%d\n",
@@ -1719,27 +1698,6 @@ createRemovalPolicy(RemovalPolicySettings * settings)
     return NULL;                /* NOTREACHED */
 }
 
-#if 0
-void
-storeSwapFileNumberSet(StoreEntry * e, sfileno filn)
-{
-    if (e->swap_file_number == filn)
-        return;
-
-    if (filn < 0) {
-        assert(-1 == filn);
-        storeDirMapBitReset(e->swap_file_number);
-        storeDirLRUDelete(e);
-        e->swap_file_number = -1;
-    } else {
-        assert(-1 == e->swap_file_number);
-        storeDirMapBitSet(e->swap_file_number = filn);
-        storeDirLRUAdd(e);
-    }
-}
-
-#endif
-
 void
 StoreEntry::storeErrorResponse(HttpReply *reply)
 {
index e6bcbee7b9bf956dea6cd5acb62f90bcd66760d9..1579e80e28df10eeee1abbde78ec3f21cdcaa448 100644 (file)
@@ -653,18 +653,9 @@ storeClientCopyPending(store_client * sc, StoreEntry * e, void *data)
 #if STORE_CLIENT_LIST_DEBUG
     assert(sc == storeClientListSearch(e->mem_obj, data));
 #endif
-#ifndef SILLY_CODE
 
     assert(sc);
-#endif
-
     assert(sc->entry == e);
-#if SILLY_CODE
-
-    if (sc == NULL)
-        return 0;
-
-#endif
 
     if (!sc->_callback.pending())
         return 0;
index 1153d66168d2497e0e72596edab0b9c3bd55ae83..01d9aee59f99300b69071d382e713fda598be2a1 100644 (file)
@@ -203,15 +203,6 @@ AnyToString(const Type &value)
     return sbuf.str();
 }
 
-#if 0
-/// helper function to convert SBuf position to a human-friendly string
-inline std::string
-PosToString(const SBuf::size_type pos)
-{
-    return pos == SBuf::npos ? std::string("npos") : AnyToString(pos);
-}
-#endif
-
 /// helper function to convert std::string position to a human-friendly string
 inline std::string
 PosToString(const std::string::size_type pos)
index b3352799d69c2051ed31a405cca0916f9d745706..9c99de7b73ba52df66c9271466785da6e2dffa47 100644 (file)
@@ -37,9 +37,6 @@ void commSetTcpKeepalive(int fd, int idle, int interval, int timeout) STUB
 void _comm_close(int fd, char const *file, int line) STUB
 void old_comm_reset_close(int fd) STUB
 void comm_reset_close(const Comm::ConnectionPointer &conn) STUB
-#if LINGERING_CLOSE
-void comm_lingering_close(int fd) STUB
-#endif
 int comm_connect_addr(int sock, const Ip::Address &addr) STUB_RETVAL(-1)
 void comm_init(void) STUB
 void comm_exit(void) STUB
index 7d6631aaee41383f7b4de6ad87fe540ad90e6d3b..2378278eb8763ab37d83750b3c101d226f55d33a 100644 (file)
@@ -218,3 +218,4 @@ testCacheManager::testParseUrl()
         }
     }
 }
+
index 0019ecad77e61488094ff77be2acd0fd9ddbdaba..362133a2732bddd03e8eaba7ca089aed225dcafa 100644 (file)
@@ -704,26 +704,6 @@ testHttp1Parser::testParseRequestLineMethods()
         input.clear();
     }
 
-#if 0
-    // too-long method (over 16 bytes)
-    {
-        input.append("HELLOSTRANGEWORLD / HTTP/1.1\r\n", 31);
-        struct resultSet expect = {
-            .parsed = false,
-            .needsMore = false,
-            .parserState = Http1::HTTP_PARSE_DONE,
-            .status = Http::scNotImplemented,
-            .suffixSz = input.length(),
-            .method = HttpRequestMethod(),
-            .uri = NULL,
-            .version = AnyP::ProtocolVersion()
-        };
-        output.clear();
-        testResults(__LINE__, input, output, expect);
-        input.clear();
-    }
-#endif
-
     // method-only
     {
         input.append("A\n", 2);
index 71af1388019db6077dd51d957dec4bee6483f044..edcd9fd27f4badf002ce5a430f8fd1e20e7119de 100644 (file)
@@ -636,19 +636,6 @@ testIpAddress::testAddrInfo()
 
     anIP.getAddrInfo(ipval);
 
-#if 0
-    /* display a byte-by-byte hex comparison of the addr cores */
-    unsigned int *p;
-    p = (unsigned int*)expect;
-    printf("\nSYS-ADDRINFO: %2x %2x %2x %2x %2x %2x",
-           p[0],p[1],p[2],p[3],p[4],p[5]);
-
-    p = (unsigned int*)ipval;
-    printf("\nSQD-ADDRINFO: %2x %2x %2x %2x %2x %2x",
-           p[0],p[1],p[2],p[3],p[4],p[5] );
-    printf("\n");
-#endif /*0*/
-
     // check the addrinfo object core. (BUT not the two ptrs at the tail)
     // details
     CPPUNIT_ASSERT_EQUAL( expect->ai_flags, ipval->ai_flags );
@@ -656,26 +643,6 @@ testIpAddress::testAddrInfo()
     // check the sockaddr it points to.
     CPPUNIT_ASSERT_EQUAL( expect->ai_addrlen, ipval->ai_addrlen );
 
-#if 0
-    printf("sizeof IN(%d), IN6(%d), STORAGE(%d), \n",
-           sizeof(struct sockaddr_in), sizeof(struct sockaddr_in6), sizeof(struct sockaddr_storage));
-
-    p = (unsigned int*)(expect->ai_addr);
-    printf("\nSYS-ADDR: (%d) {%d} %x %x %x %x %x %x %x %x ...",
-           expect->ai_addrlen, sizeof(*p),
-           p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7] );
-
-    p = (unsigned int*)(ipval->ai_addr);
-    printf("\nSQD-ADDR: (%d) {%d} %x %x %x %x %x %x %x %x ...",
-           ipval->ai_addrlen, sizeof(*p),
-           p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7] );
-    printf("\n");
-#if HAVE_SS_LEN_IN_SS
-    printf("\nSYS SS_LEN=%d\nSQD SS_LEN=%d\n",((struct sockaddr_storage*)expect->ai_addr)->ss_len,
-           ((struct sockaddr_storage*)ipval->ai_addr)->ss_len );
-#endif
-#endif /*0*/
-
 #if HAVE_SS_LEN_IN_SS
     CPPUNIT_ASSERT_EQUAL( ((struct sockaddr_storage*)expect->ai_addr)->ss_len,
                           ((struct sockaddr_storage*)ipval->ai_addr)->ss_len );
index 87794edd57cf5d4db7cdd1f1dd23191bc887b198..b301417c54ee3201088552053ca42c24c3822393 100644 (file)
@@ -145,10 +145,6 @@ testStoreController::testSearch()
     CPPUNIT_ASSERT_EQUAL(false, search->error());
     CPPUNIT_ASSERT_EQUAL(false, search->isDone());
     CPPUNIT_ASSERT_EQUAL(static_cast<StoreEntry *>(NULL), search->currentItem());
-#if 0
-
-    CPPUNIT_ASSERT_EQUAL(false, search->next());
-#endif
 
     /* trigger a callback */
     cbcalled = false;
index 0b3fa0b7d691af0e31770437644cad9bd558fde5..a676caa3d43dd747a18eccd9461e0220d627f52d 100644 (file)
@@ -139,10 +139,6 @@ testStoreHashIndex::testSearch()
     CPPUNIT_ASSERT_EQUAL(false, search->error());
     CPPUNIT_ASSERT_EQUAL(false, search->isDone());
     CPPUNIT_ASSERT_EQUAL(static_cast<StoreEntry *>(NULL), search->currentItem());
-#if 0
-
-    CPPUNIT_ASSERT_EQUAL(false, search->next());
-#endif
 
     /* trigger a callback */
     cbcalled = false;
index 905396dc67393165528d38b4e9c1282ab5e9fb96..e88966ad7b7a02c603df75770b32ea1b5a1e6214 100644 (file)
@@ -170,12 +170,6 @@ testUfs::testUfsSearch()
      */
     StoreSearchPointer search = Store::Root().search(); /* search for everything in the store */
 
-    /* nothing should be immediately available */
-#if 0
-
-    CPPUNIT_ASSERT_EQUAL(false, search->next());
-#endif
-
     CPPUNIT_ASSERT_EQUAL(false, search->error());
     CPPUNIT_ASSERT_EQUAL(false, search->isDone());
     CPPUNIT_ASSERT_EQUAL(static_cast<StoreEntry *>(NULL), search->currentItem());
index fae663da339537daba52820de332c59a8953c2d3..fe66329f9ca09e4930c4fe16ad70f7afd5ba4189 100644 (file)
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testUriScheme );
 
-#if 0
-/*
- * We should be able to make an HttpRequestMethod straight from a string.
- */
-void
-testHttpRequestMethod::testConstructCharStart()
-{
-    /* parse an empty string -> METHOD_NONE */
-    CPPUNIT_ASSERT(METHOD_NONE == HttpRequestMethod(NULL));
-    /* parsing a literal should work */
-    CPPUNIT_ASSERT(METHOD_GET == HttpRequestMethod("GET", NULL));
-}
-
-/*
- * We can also parse precise ranges of characters
- */
-void
-testHttpRequestMethod::testConstructCharStartEnd()
-{
-    char const * buffer;
-    /* parse an empty string -> METHOD_NONE */
-    CPPUNIT_ASSERT(METHOD_NONE == HttpRequestMethod(NULL, NULL));
-    /* parsing a literal should work */
-    CPPUNIT_ASSERT(METHOD_GET == HttpRequestMethod("GET", NULL));
-    /* parsing with an explicit end should work */
-    buffer = "POSTPLUS";
-    CPPUNIT_ASSERT(METHOD_POST == HttpRequestMethod(buffer, buffer + 4));
-}
-
-#endif
-
 /*
  * we should be able to assign a protocol_t to a AnyP::UriScheme for ease
  * of code conversion
index 5a84fec0613bd038921946fb1627e58400210503..35e124100b3136ce914385d8cfae6ef76b223bce 100644 (file)
@@ -21,12 +21,6 @@ class testUriScheme : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST( testAssignFromprotocol_t );
     CPPUNIT_TEST( testCastToprotocol_t );
     CPPUNIT_TEST( testConstructprotocol_t );
-#if 0
-
-    CPPUNIT_TEST( testConstructCharStart );
-    CPPUNIT_TEST( testConstructCharStartEnd );
-#endif
-
     CPPUNIT_TEST( testDefaultConstructor );
     CPPUNIT_TEST( testEqualprotocol_t );
     CPPUNIT_TEST( testNotEqualprotocol_t );
@@ -41,12 +35,6 @@ protected:
     void testAssignFromprotocol_t();
     void testCastToprotocol_t();
     void testConstructprotocol_t();
-#if 0
-
-    void testConstructCharStart();
-    void testConstructCharStartEnd();
-#endif
-
     void testC_str();
     void testDefaultConstructor();
     void testEqualprotocol_t();
index e37d3fcebd365705a6944aab9f0cdf9fb130d412..8c9edd86d2bebbb85835d7a37a06faaf77822cad 100644 (file)
@@ -40,12 +40,6 @@ main ()
 
     while (strlen (expressions[i])) {
         int result = ESIExpression::Evaluate (expressions[i]);
-#if VERBOSEDEBUG
-
-        printf("Expr '%s' = '%s' (expected %s)\n", expressions[i],
-               result ? "true" : "false",
-               results[i] ? "true" : "false");
-#endif
 
         if (result != results[i])
             return 1;
index 6256948e248e6796c667708caf9de0a43b6089a8..2f2b735939b8aa60a06826ba111a4e62b6ba758b 100644 (file)
@@ -278,12 +278,6 @@ get_header_string_value(const char *hdr, const char *buf, const char *end)
 void
 request_done(struct _r *r)
 {
-#if 0
-    fprintf(stderr, "DONE: %s, (%d+%d)\n",
-            r->url,
-            r->hdr_length,
-            r->content_length);
-#endif
     if (r->content_length != r->bytes_read)
         fprintf(stderr, "ERROR! Short reply, expected %d bytes got %d\n",
                 r->content_length, r->bytes_read);
@@ -343,14 +337,7 @@ handle_read(char *inbuf, int len)
         }
         /* Process headers */
         if (r->hdr_length == 0 && (end = mime_headers_end(r->reply_hdrs)) != NULL) {
-#if 0
-            fprintf(stderr, "FOUND EOH FOR %s\n", r->url);
-            */
-#endif
             r->hdr_length = end - r->reply_hdrs;
-#if 0
-            fprintf(stderr, "HDR_LENGTH = %d\n", r->hdr_length);
-#endif
             /* "unread" any body contents received */
             blen = r->hdr_offset - r->hdr_length;
             assert(blen >= 0);
index e531b69db2a23f313526b86fbf7c817948edbbbf..43bf3b5a17481c0db5061ad9e4c4f6d123c273e2 100644 (file)
@@ -133,10 +133,6 @@ get_url(const char *url)
         *t = '\0';
         port = (unsigned short) atoi(t + 1);
     }
-#if 0
-    if ((int) port != 80)
-        return 0;
-#endif
     t = strchr(url + 7, '/');
     strncpy(path, (t ? t : "/"), URL_BUF_SZ);
     memset(&S, '\0', sizeof(S));
index 2420545fd86560b9e10af349128a4651d59940ad..1d02fa34bb7732d13b2ca76e8b191778c3c92efa 100644 (file)
@@ -911,23 +911,12 @@ main(int argc, char *argv[])
 
     char **args = argv;
     while (argc > 1 && args[1][0] == '-') {
-//        const char *value = "";
         char option = args[1][1];
         switch (option) {
         case 'd':
             debug_enabled = 1;
             break;
         default:
-#if 0 // unused for now.
-            if (strlen(args[1]) > 2) {
-                value = args[1] + 2;
-            } else if (argc > 2) {
-                value = args[2];
-                ++args;
-                --argc;
-            } else
-                value = "";
-#endif
             break;
         }
         ++args;
@@ -1252,7 +1241,7 @@ check_target_acl(const char *hostname, int port)
 
     if (fp == NULL) {
 #ifdef CACHEMGR_HOSTNAME_DEFINED
-
+        // TODO: simplify and maybe get rid of CACHEMGR_HOSTNAME altogether
         if (strcmp(hostname, CACHEMGR_HOSTNAME) == 0 && port == CACHE_HTTP_PORT)
             return 1;
 
index 7d9d369291d645c6be35dd1ef48b358754f3d6c6..cae672525b4fc1506103d536dff8c7c8877e0295 100644 (file)
@@ -580,13 +580,7 @@ checkForPortOnly( const char* arg )
     unsigned long result = strtoul( arg, &errstr, 0 );
     if ( result < 65536 && errstr != arg ) return htons(result);
 
-#if 0
-    // one last try, test for a symbolical service name
-    struct servent* service = getservbyname( arg, "tcp" );
-    return service ? service->s_port : -1;
-#else
     return -1;
-#endif
 }
 
 void
index c3ba05bd9a3bd4ab1ca14e1940802251efb3999b..657efd15c179d632227581536366a5276e237077 100644 (file)
@@ -98,7 +98,7 @@ Signal( int signo, SigFunc* newhandler, bool doInterrupt )
            (SigFunc*) old.sa_handler;
 }
 
-SIGRETTYPE
+void
 sigChild( int signo )
 // purpose: supply ad hoc child handler with output on stderr
 // paramtr: signo (IN): == SIGCHLD
@@ -128,9 +128,5 @@ sigChild( int signo )
         }
     }
     errno = saveerr;
-
-#if SIGRETTYPE != void
-    return 0;
-#endif
 }
 
index 4609829ce2119a49c5ef088150742a6b2c47cb51..051f8c9c57185e01236e0b3d32af0114d0afd338 100644 (file)
 // File:     signal.hh
 // Date:     Sat Feb 28 1998
 // Compiler: gcc 2.7.2.x series
-// 
+//
 // Books:    W. Richard Steven, "Advanced Programming in the UNIX Environment",
 //           Addison-Wesley, 1992.
-// 
+//
 // (c) 1998 Lehrgebiet Rechnernetze und Verteilte Systeme
 //          Universit?t Hannover, Germany
 //
@@ -69,12 +69,6 @@ typedef int bool;
 #endif
 #endif /* __cplusplus */
 
-#if 1 // so far, all systems I know use void
-# define SIGRETTYPE void
-#else
-# define SIGRETTYPE int
-#endif
-
 #if defined(SUNOS) && defined(SUN)
 # define SIGPARAM void
 #else // SOLARIS, LINUX, IRIX, AIX, SINIXY
@@ -82,7 +76,7 @@ typedef int bool;
 #endif
 
 extern "C" {
-  typedef SIGRETTYPE SigFunc( SIGPARAM );
+  typedef void SigFunc( SIGPARAM );
 }
 
 SigFunc*
@@ -93,7 +87,7 @@ Signal( int signo, SigFunc* newhandler, bool doInterrupt );
   //          doInterrupt (IN): interrupted system calls wanted!
   // returns: the old signal handler, or SIG_ERR in case of error.
 
-SIGRETTYPE
+void
 sigChild( int signo );
   // purpose: supply ad hoc child handler with output on stderr
   // paramtr: signo (IN): == SIGCHLD