]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Fixed coredump in icpStateFree() when calling
authorwessels <>
Fri, 20 Sep 1996 12:28:12 +0000 (12:28 +0000)
committerwessels <>
Fri, 20 Sep 1996 12:28:12 +0000 (12:28 +0000)
          checkFailureRatio().
        - Added more stuff to net_db.c.
        - Fixed memory leak in stat_ipcache_get().
        - Changed __P back to _PARAMS.

37 files changed:
ChangeLog
include/tempnam.h
include/util.h
lib/base64.c
lib/util.c
src/Makefile.in
src/acl.cc
src/cache_cf.cc
src/cachemgr.cc
src/client.cc
src/client_side.cc
src/comm.cc
src/debug.cc
src/disk.cc
src/dns.cc
src/errorpage.cc
src/filemap.cc
src/fqdncache.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/icmp.cc
src/ident.cc
src/ipcache.cc
src/main.cc
src/neighbors.cc
src/net_db.cc
src/recv-announce.cc
src/redirect.cc
src/squid.h
src/ssl.cc
src/stat.cc
src/stmem.cc
src/store.cc
src/tools.cc
src/tunnel.cc
src/wais.cc

index 48f7d221aca83c1f52989f6dce265f6acbf868d4..636606e997a1a4b21cbc2b5e2d1facb5eecf768d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-Changes to squid-1.1.beta3 ():
+Changes to squid-1.1.beta4 ():
+
+       - Fixed coredump in icpStateFree() when calling
+         checkFailureRatio().
+       - Added more stuff to net_db.c.
+       - Fixed memory leak in stat_ipcache_get().
+       - Changed __P back to _PARAMS.
+
+Changes to squid-1.1.beta3 (September 16, 1996):
 
        - s/()/(void)/
        - Fixed 8k page leak in icmpRecv().
@@ -18,7 +26,7 @@ Changes to squid-1.1.beta3 ():
        - Includes squid-1.0 changes up to 1.0.16.
        - s/__STRICT_ANSI__/__STDC__/g
 
-Changes to squid-1.1.beta2 (September 16, 1996):
+Changes to squid-1.1.beta2 (September 12, 1996):
 
        - Switched to ANSI style coding.
        - Fixed UDP_HIT_OBJ objects ignoring 'proxy-only' setting.
index a62c1dbe4c8760a87588750934857583c7dfad68..e69219fe95c4766bfc996b2717d033f55bc00e2c 100644 (file)
@@ -17,5 +17,5 @@
 
 #ifndef _TEMPNAM_H
 #define _TEMPNAM_H
-extern char *tempnam __P((const char *, const char *));
+extern char *tempnam _PARAMS((const char *, const char *));
 #endif /* _TEMPNAM_H */
index 34e21f9da56afbbd5cf3db411b91087c1fef8c02..565d51893c4c55da5bfff943e78de9b38bcc5a08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.19 1996/09/18 22:44:39 wessels Exp $
+ * $Id: util.h,v 1.20 1996/09/20 06:28:18 wessels Exp $
  *
  * AUTHOR: Harvest Derived
  *
 #endif
 
 #if !HAVE_STRDUP
-extern char *strdup __P((char *));
+extern char *strdup _PARAMS((char *));
 #endif
-extern char *xstrdup __P((char *));    /* Duplicate a string */
+extern char *xstrdup _PARAMS((char *));        /* Duplicate a string */
 
 /* from xmalloc.c */
-void *xmalloc __P((size_t));   /* Wrapper for malloc(3) */
-void *xrealloc __P((void *, size_t));  /* Wrapper for realloc(3) */
-void *xcalloc __P((int, size_t));      /* Wrapper for calloc(3) */
-void xfree __P((void *));      /* Wrapper for free(3) */
-void xxfree __P((void *));     /* Wrapper for free(3) */
-char *xstrdup __P((char *));
-char *xstrerror __P((void));
-char *getfullhostname __P((void));
-void xmemcpy __P((void *, void *, int));
+void *xmalloc _PARAMS((size_t));       /* Wrapper for malloc(3) */
+void *xrealloc _PARAMS((void *, size_t));      /* Wrapper for realloc(3) */
+void *xcalloc _PARAMS((int, size_t));  /* Wrapper for calloc(3) */
+void xfree _PARAMS((void *));  /* Wrapper for free(3) */
+void xxfree _PARAMS((void *)); /* Wrapper for free(3) */
+char *xstrdup _PARAMS((char *));
+char *xstrerror _PARAMS((void));
+char *getfullhostname _PARAMS((void));
+void xmemcpy _PARAMS((void *, void *, int));
 
 #if XMALLOC_STATISTICS
-void malloc_statistics __P((void (*)__P((int, int, void *)), void *));
+void malloc_statistics _PARAMS((void (*)_PARAMS((int, int, void *)), void *));
 #endif
 
 /* from debug.c */
@@ -172,25 +172,25 @@ extern int Harvest_debug_levels[];
         {if (debug_ok_fast((section),(level))) {Log X;}}
 #endif
 
-void debug_flag __P((char *));
+void debug_flag _PARAMS((char *));
 
-char *mkhttpdlogtime __P((time_t *));
-extern char *mkrfc850 __P((time_t));
-extern time_t parse_rfc850 __P((char *str));
-extern void init_log3 __P((char *pn, FILE * a, FILE * b));
-extern void debug_init __P((void));
-extern void log_errno2 __P((char *, int, char *));
+char *mkhttpdlogtime _PARAMS((time_t *));
+extern char *mkrfc850 _PARAMS((time_t));
+extern time_t parse_rfc850 _PARAMS((char *str));
+extern void init_log3 _PARAMS((char *pn, FILE * a, FILE * b));
+extern void debug_init _PARAMS((void));
+extern void log_errno2 _PARAMS((char *, int, char *));
 
 #if __STDC__
-extern void Log __P((char *,...));
-extern void errorlog __P((char *,...));
+extern void Log _PARAMS((char *,...));
+extern void errorlog _PARAMS((char *,...));
 #else
-extern void Log __P(());
-extern void errorlog __P(());
+extern void Log _PARAMS(());
+extern void errorlog _PARAMS(());
 #endif /* __STDC__ */
 
-extern void Tolower __P((char *));
+extern void Tolower _PARAMS((char *));
 
-extern char *uudecode __P((char *));
+extern char *uudecode _PARAMS((char *));
 
 #endif /* ndef _UTIL_H_ */
index 4a6ad7c3e1226881a1cd7d7b47d4060329656290..64bd7614073b56445130616f5c436be9e9461bf7 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "ansiproto.h"
 
-static void base64_init __P((void));
+static void base64_init _PARAMS((void));
 
 static int base64_initialized = 0;
 int base64_value[256];
index 93d7e96269a3ddb30ef619bf27ff3ce26c9fdc9e..1616b9ef387cf6ecb923e78c3413dc833381507c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.c,v 1.18 1996/09/17 16:54:00 wessels Exp $
+ * $Id: util.c,v 1.19 1996/09/20 06:28:22 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
 #include "ansiproto.h"
 #include "util.h"
 
-void (*failure_notify) __P((char *)) = NULL;
+void (*failure_notify) _PARAMS((char *)) = NULL;
 static char msg[128];
 
 extern int sys_nerr;
index 48b8b195fcee2c706a36082748b2471939f77415..547b4d106a5a51d151524db45184f02cd4791623 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.41 1996/09/18 21:39:26 wessels Exp $
+#  $Id: Makefile.in,v 1.42 1996/09/20 06:28:23 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -62,7 +62,7 @@ OBJS          = acl.o async_io.o background.o cache_cf.o errorpage.o \
                client_side.o comm.o debug.o disk.o dns.o \
                fdstat.o filemap.o ftp.o fqdncache.o gopher.o \
                hash.o http.o icmp.o icp.o ident.o ipcache.o \
-               main.o mime.o neighbors.o objcache.o \
+               main.o mime.o neighbors.o net_db.o objcache.o \
                proto.o redirect.o send-announce.o ssl.o stack.o stat.o stmem.o \
                store.o store_clean.o storetoString.o tools.o ttl.o \
                url.o wais.o $(XTRA_OBJS)
index f5d7e624bbf147f642a6267943a31d1fced2ee1b..1199cb6c662c30c2d4ecb21a02eb898d638ed845 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: acl.cc,v 1.42 1996/09/18 21:39:27 wessels Exp $
+ * $Id: acl.cc,v 1.43 1996/09/20 06:28:24 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -44,26 +44,26 @@ struct _acl_access *DelayAccessList = NULL;
 static struct _acl *AclList = NULL;
 static struct _acl **AclListTail = &AclList;
 
-static void aclDestroyAclList __P((struct _acl_list * list));
-static void aclDestroyIpList __P((struct _acl_ip_data * data));
-static void aclDestroyRegexList __P((struct _relist * data));
-static void aclDestroyTimeList __P((struct _acl_time_data * data));
-static int aclMatchDomainList __P((wordlist *, char *));
-static int aclMatchAclList __P((struct _acl_list *, aclCheck_t *));
-static int aclMatchInteger __P((intlist * data, int i));
-static int aclMatchIp __P((struct _acl_ip_data * data, struct in_addr c));
-static int aclMatchRegex __P((relist * data, char *word));
-static int aclMatchTime __P((struct _acl_time_data * data, time_t when));
-static intlist *aclParseIntlist __P((void));
-static struct _acl_ip_data *aclParseIpList __P((void));
-static intlist *aclParseMethodList __P((void));
-static intlist *aclParseProtoList __P((void));
-static struct _relist *aclParseRegexList __P((void));
-static struct _acl_time_data *aclParseTimeSpec __P((void));
-static wordlist *aclParseWordList __P((void));
-static wordlist *aclParseDomainList __P((void));
-static squid_acl aclType __P((char *s));
-static int decode_addr __P((char *, struct in_addr *, struct in_addr *));
+static void aclDestroyAclList _PARAMS((struct _acl_list * list));
+static void aclDestroyIpList _PARAMS((struct _acl_ip_data * data));
+static void aclDestroyRegexList _PARAMS((struct _relist * data));
+static void aclDestroyTimeList _PARAMS((struct _acl_time_data * data));
+static int aclMatchDomainList _PARAMS((wordlist *, char *));
+static int aclMatchAclList _PARAMS((struct _acl_list *, aclCheck_t *));
+static int aclMatchInteger _PARAMS((intlist * data, int i));
+static int aclMatchIp _PARAMS((struct _acl_ip_data * data, struct in_addr c));
+static int aclMatchRegex _PARAMS((relist * data, char *word));
+static int aclMatchTime _PARAMS((struct _acl_time_data * data, time_t when));
+static intlist *aclParseIntlist _PARAMS((void));
+static struct _acl_ip_data *aclParseIpList _PARAMS((void));
+static intlist *aclParseMethodList _PARAMS((void));
+static intlist *aclParseProtoList _PARAMS((void));
+static struct _relist *aclParseRegexList _PARAMS((void));
+static struct _acl_time_data *aclParseTimeSpec _PARAMS((void));
+static wordlist *aclParseWordList _PARAMS((void));
+static wordlist *aclParseDomainList _PARAMS((void));
+static squid_acl aclType _PARAMS((char *s));
+static int decode_addr _PARAMS((char *, struct in_addr *, struct in_addr *));
 
 static squid_acl
 aclType(char *s)
index 820cc84408c122576fad902b9e60abfe01a91c97..d07cef361a6d51878d3ed30180e623a0b26b69bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.95 1996/09/18 21:41:07 wessels Exp $
+ * $Id: cache_cf.cc,v 1.96 1996/09/20 06:28:27 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -208,52 +208,52 @@ char w_space[] = " \t\n";
 char config_input_line[BUFSIZ];
 int config_lineno = 0;
 
-static char *safe_xstrdup __P((char *p));
-static void parseOnOff __P((int *));
-static void parseIntegerValue __P((int *));
+static char *safe_xstrdup _PARAMS((char *p));
+static void parseOnOff _PARAMS((int *));
+static void parseIntegerValue _PARAMS((int *));
 static char fatal_str[BUFSIZ];
 
-static void configDoConfigure __P((void));
-static void configFreeMemory __P((void));
-static void configSetFactoryDefaults __P((void));
-static void parseAccessLogLine __P((void));
-static void parseAddressLine __P((struct in_addr *));
-static void parseAnnounceToLine __P((void));
-static void parseAppendDomainLine __P((void));
-static void parseCacheAnnounceLine __P((void));
-static void parseCacheHostLine __P((void));
-static void parseDebugOptionsLine __P((void));
-static void parseDnsProgramLine __P((void));
-static void parseEffectiveUserLine __P((void));
-static void parseErrHtmlLine __P((void));
-static void parseFtpLine __P((void));
-static void parseFtpOptionsLine __P((void));
-static void parseFtpProgramLine __P((void));
-static void parseFtpUserLine __P((void));
-static void parseGopherLine __P((void));
-static void parseWordlist __P((wordlist **));
-static void parseHostAclLine __P((void));
-static void parseHostDomainLine __P((void));
-static void parseHotVmFactorLine __P((void));
-static void parseHttpLine __P((void));
-static void parseHttpPortLine __P((void));
-static void parseHttpdAccelLine __P((void));
-static void parseIPLine __P((ip_acl ** list));
-static void parseIcpPortLine __P((void));
-static void parseLocalDomainFile __P((char *fname));
-static void parseLocalDomainLine __P((void));
-static void parseLogLine __P((void));
-static void parseMemLine __P((void));
-static void parseMgrLine __P((void));
-static void parsePidFilenameLine __P((void));
-static void parseRequestSizeLine __P((void));
-static void parseStoreLogLine __P((void));
-static void parseSwapLine __P((void));
-static void parseTTLPattern __P((int icase, int force));
-static void parseVisibleHostnameLine __P((void));
-static void parseWAISRelayLine __P((void));
-static void parseMinutesLine __P((int *));
-static void ip_acl_destroy __P((ip_acl **));
+static void configDoConfigure _PARAMS((void));
+static void configFreeMemory _PARAMS((void));
+static void configSetFactoryDefaults _PARAMS((void));
+static void parseAccessLogLine _PARAMS((void));
+static void parseAddressLine _PARAMS((struct in_addr *));
+static void parseAnnounceToLine _PARAMS((void));
+static void parseAppendDomainLine _PARAMS((void));
+static void parseCacheAnnounceLine _PARAMS((void));
+static void parseCacheHostLine _PARAMS((void));
+static void parseDebugOptionsLine _PARAMS((void));
+static void parseDnsProgramLine _PARAMS((void));
+static void parseEffectiveUserLine _PARAMS((void));
+static void parseErrHtmlLine _PARAMS((void));
+static void parseFtpLine _PARAMS((void));
+static void parseFtpOptionsLine _PARAMS((void));
+static void parseFtpProgramLine _PARAMS((void));
+static void parseFtpUserLine _PARAMS((void));
+static void parseGopherLine _PARAMS((void));
+static void parseWordlist _PARAMS((wordlist **));
+static void parseHostAclLine _PARAMS((void));
+static void parseHostDomainLine _PARAMS((void));
+static void parseHotVmFactorLine _PARAMS((void));
+static void parseHttpLine _PARAMS((void));
+static void parseHttpPortLine _PARAMS((void));
+static void parseHttpdAccelLine _PARAMS((void));
+static void parseIPLine _PARAMS((ip_acl ** list));
+static void parseIcpPortLine _PARAMS((void));
+static void parseLocalDomainFile _PARAMS((char *fname));
+static void parseLocalDomainLine _PARAMS((void));
+static void parseLogLine _PARAMS((void));
+static void parseMemLine _PARAMS((void));
+static void parseMgrLine _PARAMS((void));
+static void parsePidFilenameLine _PARAMS((void));
+static void parseRequestSizeLine _PARAMS((void));
+static void parseStoreLogLine _PARAMS((void));
+static void parseSwapLine _PARAMS((void));
+static void parseTTLPattern _PARAMS((int icase, int force));
+static void parseVisibleHostnameLine _PARAMS((void));
+static void parseWAISRelayLine _PARAMS((void));
+static void parseMinutesLine _PARAMS((int *));
+static void ip_acl_destroy _PARAMS((ip_acl **));
 
 void
 self_destruct(void)
@@ -276,8 +276,7 @@ ip_acl_match(struct in_addr c, ip_acl * a)
 }
 
 static void
-ip_acl_destroy(a)
-     ip_acl **a;
+ip_acl_destroy(ip_acl ** a)
 {
     ip_acl *b;
     ip_acl *n;
index cfb0915ff1b905b89a62a983892b350fad80da3c..5540227da53506f51f52e3b6330c610fa80b232f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cachemgr.cc,v 1.27 1996/09/18 21:39:29 wessels Exp $
+ * $Id: cachemgr.cc,v 1.28 1996/09/20 06:28:29 wessels Exp $
  *
  * DEBUG: Section 0     CGI Cache Manager
  * AUTHOR: Harvest Derived
@@ -269,7 +269,7 @@ int hasTables = FALSE;
 char *script_name = "/cgi-bin/cachemgr.cgi";
 char *progname = NULL;
 
-static int client_comm_connect __P((int sock, char *dest_host, u_short dest_port));
+static int client_comm_connect _PARAMS((int sock, char *dest_host, u_short dest_port));
 
 void
 print_trailer(void)
index 4d34fb619406ae9828d39792d637580eec91bf8e..fa2877eec5d942610c9ab750de250dc29c0fe86a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client.cc,v 1.10 1996/09/15 05:04:15 wessels Exp $
+ * $Id: client.cc,v 1.11 1996/09/20 06:28:30 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
 #endif
 
 /* Local functions */
-static int client_comm_connect __P((int sock, char *dest_host, u_short dest_port));
-static void usage __P((char *progname));
+static int client_comm_connect _PARAMS((int sock, char *dest_host, u_short dest_port));
+static void usage _PARAMS((char *progname));
 
 static void
 usage(char *progname)
index 370424754ad6ebf8dbd8bae0263224a71fedc2ee..a32cbaf294921fb390eb48709d288c4a5b72705d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.34 1996/09/18 21:41:08 wessels Exp $
+ * $Id: client_side.cc,v 1.35 1996/09/20 06:28:30 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
 
 #include "squid.h"
 
-static void clientRedirectDone __P((void *data, char *result));
-static int icpHandleIMSReply __P((int fd, StoreEntry * entry, void *data));
-static void clientLookupDstIPDone __P((int fd, struct hostent * hp, void *data));
-static void clientLookupSrcFQDNDone __P((int fd, char *fqdn, void *data));
+static void clientRedirectDone _PARAMS((void *data, char *result));
+static int icpHandleIMSReply _PARAMS((int fd, StoreEntry * entry, void *data));
+static void clientLookupDstIPDone _PARAMS((int fd, struct hostent * hp, void *data));
+static void clientLookupSrcFQDNDone _PARAMS((int fd, char *fqdn, void *data));
 
 
 static void
index 0f6687bfe1847088faa5d3aec742fc423fa1b016..daaba8ec4f2af7cca6be89cb25c839b916856f91 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.75 1996/09/18 21:39:30 wessels Exp $
+ * $Id: comm.cc,v 1.76 1996/09/20 06:28:32 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -137,19 +137,19 @@ struct _RWStateData {
 FD_ENTRY *fd_table = NULL;     /* also used in disk.c */
 
 /* STATIC */
-static void checkTimeouts __P((void));
-static void checkLifetimes __P((void));
-static void Reserve_More_FDs __P((void));
-static void commSetReuseAddr __P((int));
-static int examine_select __P((fd_set *, fd_set *, fd_set *));
-static void commSetNoLinger __P((int));
-static void comm_select_incoming __P((void));
-static int commBind __P((int s, struct in_addr, u_short port));
-static void RWStateCallbackAndFree __P((int fd, int code));
+static void checkTimeouts _PARAMS((void));
+static void checkLifetimes _PARAMS((void));
+static void Reserve_More_FDs _PARAMS((void));
+static void commSetReuseAddr _PARAMS((int));
+static int examine_select _PARAMS((fd_set *, fd_set *, fd_set *));
+static void commSetNoLinger _PARAMS((int));
+static void comm_select_incoming _PARAMS((void));
+static int commBind _PARAMS((int s, struct in_addr, u_short port));
+static void RWStateCallbackAndFree _PARAMS((int fd, int code));
 #ifdef TCP_NODELAY
-static void commSetTcpNoDelay __P((int));
+static void commSetTcpNoDelay _PARAMS((int));
 #endif
-static void commSetTcpRcvbuf __P((int, int));
+static void commSetTcpRcvbuf _PARAMS((int, int));
 
 static int *fd_lifetime = NULL;
 static struct timeval zero_tv;
@@ -617,6 +617,7 @@ comm_select_incoming(void)
     if (maxfd++ == 0)
        return;
     if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) > 0) {
+       getCurrentTime();
        for (i = 0; i < N; i++) {
            fd = fds[i];
            if (FD_ISSET(fd, &read_mask)) {
@@ -712,6 +713,7 @@ comm_select(time_t sec)
            poll_time.tv_usec = 0;
 #endif
            num = select(maxfd, &readfds, &writefds, &exceptfds, &poll_time);
+           getCurrentTime();
            if (num >= 0)
                break;
            if (errno == EINTR)
@@ -837,7 +839,10 @@ comm_set_select_handler_plus_timeout(int fd, unsigned int type, PF handler, void
 }
 
 int
-comm_get_select_handler(int fd, unsigned int type, int (**handler_ptr) (), void **client_data_ptr)
+comm_get_select_handler(int fd,
+    unsigned int type,
+    int (**handler_ptr) _PARAMS((int, void *)),
+    void **client_data_ptr)
 {
     if (type & COMM_SELECT_TIMEOUT) {
        *handler_ptr = fd_table[fd].timeout_handler;
index 56a4aa2e73cb0c9a9b28670fbb594bac1ffd7c17..7ad8a311f0cc6263597e06f3981a82562e1c35ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.26 1996/09/18 22:44:49 wessels Exp $
+ * $Id: debug.cc,v 1.27 1996/09/20 06:28:33 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -114,7 +114,7 @@ static char *debug_log_file = NULL;
 #define MAX_DEBUG_SECTIONS 50
 static int debugLevels[MAX_DEBUG_SECTIONS];
 
-#if __STDC__ 
+#if __STDC__
 void
 _db_print(int section, int level, char *format,...)
 {
@@ -135,7 +135,7 @@ _db_print(va_alist)
     if (debug_log == NULL)
        return;
 
-#if __STDC__ 
+#if __STDC__
     va_start(args, format);
 #else
     va_start(args);
index b39537b1a9e2547d251911f48ad7390981a28562..c2b2659e8ffdab848ce1d66806fc17e7235e2d56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.27 1996/09/17 16:32:37 wessels Exp $
+ * $Id: disk.cc,v 1.28 1996/09/20 06:28:35 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -145,7 +145,7 @@ disk_init(void)
 
 /* Open a disk file. Return a file descriptor */
 int
-file_open(char *path, int (*handler) (), int mode)
+file_open(char *path, int (*handler) _PARAMS((void)), int mode)
 {
     FD_ENTRY *conn;
     int fd;
@@ -336,9 +336,9 @@ file_write(int fd,
     char *ptr_to_buf,
     int len,
     int access_code,
-    void (*handle) (),
+    void (*handle) _PARAMS((int, int, StoreEntry *)),
     void *handle_data,
-    void (*free_func) (void *))
+    void (*free_func) _PARAMS((void *)))
 {
     dwrite_q *wq = NULL;
 
index 9ad470af16e0ca81d96a84bcd1f737931aad482d..645fe1aa4c67702a68feeeef5d722e9c5abe2d3e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dns.cc,v 1.12 1996/09/17 16:32:38 wessels Exp $
+ * $Id: dns.cc,v 1.13 1996/09/20 06:28:36 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -110,7 +110,7 @@ struct dnsQueueData {
     void *data;
 };
 
-static int dnsOpenServer __P((char *command));
+static int dnsOpenServer _PARAMS((char *command));
 
 static dnsserver_t **dns_child_table = NULL;
 static int NDnsServersAlloc = 0;
index 29d695f56fc0381c62134c825a1a73c6b96f8752..3ed83194df0b2a2d03711bbca71e0f6fe1a310da 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.40 1996/09/17 16:32:39 wessels Exp $
+ * $Id: errorpage.cc,v 1.41 1996/09/20 06:28:37 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -306,8 +306,9 @@ from this cache.\n\
 <P>\n\
 You may take a look at\n\
 <PRE> <A HREF=\"%s\">%s</A></PRE>\n\
-or check with the cache administrator if you\n\
-believe this is incorrect.\n\
+or check with the\n\
+<A HREF=\"mailto:%s\">cache administrator</A>\n\
+if you believe this is incorrect.\n\
 <P>\n\
 %s\n\
 <HR>\n\
@@ -320,6 +321,7 @@ Generated by %s/%s@%s\n\
        url,
        redirect,
        redirect,
+       Config.adminEmail,
        Config.errHtmlText,
        appname,
        version_string,
index 62d91fb8165eac1610a56ded59cb1b566381c3fd..96cd8e7c2e578eadf7aa96aa0872f2c89db3a58b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filemap.cc,v 1.10 1996/09/15 05:04:23 wessels Exp $
+ * $Id: filemap.cc,v 1.11 1996/09/20 06:28:41 wessels Exp $
  *
  * DEBUG: section 8     Swap File Bitmap
  * AUTHOR: Harvest Derived
 #define ALL_ONES (unsigned long) 0xFFFFFFFF
 #endif
 
-extern int storeGetSwapSpace __P((int));
-extern void fatal_dump __P((char *));
+extern int storeGetSwapSpace _PARAMS((int));
+extern void fatal_dump _PARAMS((char *));
 
 static fileMap *fm = NULL;
 
index bbced8dbfe85ccc62bc3bfba8ce4c363b72615dd..51fb128ab931a86ff2cdf98bd616423a37680c1c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.20 1996/09/17 02:29:55 wessels Exp $
+ * $Id: fqdncache.cc,v 1.21 1996/09/20 06:28:42 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -136,26 +136,26 @@ static struct {
     int ghba_calls;            /* # calls to blocking gethostbyaddr() */
 } FqdncacheStats;
 
-static int fqdncache_compareLastRef __P((fqdncache_entry **, fqdncache_entry **));
-static int fqdncache_dnsHandleRead __P((int, dnsserver_t *));
-static fqdncache_entry *fqdncache_parsebuffer __P((char *buf, dnsserver_t *));
-static int fqdncache_purgelru __P((void));
-static void fqdncache_release __P((fqdncache_entry *));
-static fqdncache_entry *fqdncache_GetFirst __P((void));
-static fqdncache_entry *fqdncache_GetNext __P((void));
-static fqdncache_entry *fqdncache_create __P((void));
-static void fqdncache_add_to_hash __P((fqdncache_entry *));
-static void fqdncache_call_pending __P((fqdncache_entry *));
-static void fqdncache_call_pending_badname __P((int fd, FQDNH handler, void *));
-static void fqdncache_add __P((char *, fqdncache_entry *, struct hostent *, int));
-static int fqdncacheHasPending __P((fqdncache_entry *));
-static fqdncache_entry *fqdncache_get __P((char *));
-static void dummy_handler __P((int, char *, void *));
-static int fqdncacheExpiredEntry __P((fqdncache_entry *));
-static void fqdncacheAddPending __P((fqdncache_entry *, int fd, FQDNH, void *));
-static void fqdncacheEnqueue __P((fqdncache_entry *));
-static void *fqdncacheDequeue __P((void));
-static void fqdncache_dnsDispatch __P((dnsserver_t *, fqdncache_entry *));
+static int fqdncache_compareLastRef _PARAMS((fqdncache_entry **, fqdncache_entry **));
+static int fqdncache_dnsHandleRead _PARAMS((int, dnsserver_t *));
+static fqdncache_entry *fqdncache_parsebuffer _PARAMS((char *buf, dnsserver_t *));
+static int fqdncache_purgelru _PARAMS((void));
+static void fqdncache_release _PARAMS((fqdncache_entry *));
+static fqdncache_entry *fqdncache_GetFirst _PARAMS((void));
+static fqdncache_entry *fqdncache_GetNext _PARAMS((void));
+static fqdncache_entry *fqdncache_create _PARAMS((void));
+static void fqdncache_add_to_hash _PARAMS((fqdncache_entry *));
+static void fqdncache_call_pending _PARAMS((fqdncache_entry *));
+static void fqdncache_call_pending_badname _PARAMS((int fd, FQDNH handler, void *));
+static void fqdncache_add _PARAMS((char *, fqdncache_entry *, struct hostent *, int));
+static int fqdncacheHasPending _PARAMS((fqdncache_entry *));
+static fqdncache_entry *fqdncache_get _PARAMS((char *));
+static void dummy_handler _PARAMS((int, char *, void *));
+static int fqdncacheExpiredEntry _PARAMS((fqdncache_entry *));
+static void fqdncacheAddPending _PARAMS((fqdncache_entry *, int fd, FQDNH, void *));
+static void fqdncacheEnqueue _PARAMS((fqdncache_entry *));
+static void *fqdncacheDequeue _PARAMS((void));
+static void fqdncache_dnsDispatch _PARAMS((dnsserver_t *, fqdncache_entry *));
 
 static HashID fqdn_table = 0;
 static struct fqdncacheQueueData *fqdncacheQueueHead = NULL;
index b3839d6d9a8ecc0f06692eb645df1e99666bcdbe..80e8978b621705ac59a3bb477f2753a18f55ab9c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.59 1996/09/18 21:39:31 wessels Exp $
+ * $Id: ftp.cc,v 1.60 1996/09/20 06:28:43 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -127,11 +127,11 @@ typedef struct _Ftpdata {
 } FtpData;
 
 /* Local functions */
-static int ftpStateFree __P((int fd, FtpData * ftpState));
-static void ftpProcessReplyHeader __P((FtpData * data, char *buf, int size));
-static void ftpServerClosed __P((int fd, void *nodata));
-static void ftp_login_parser __P((char *login, FtpData * data));
-static char *ftpTransferMode __P((char *urlpath));
+static int ftpStateFree _PARAMS((int fd, FtpData * ftpState));
+static void ftpProcessReplyHeader _PARAMS((FtpData * data, char *buf, int size));
+static void ftpServerClosed _PARAMS((int fd, void *nodata));
+static void ftp_login_parser _PARAMS((char *login, FtpData * data));
+static char *ftpTransferMode _PARAMS((char *urlpath));
 
 /* Global functions not declared in ftp.h */
 void ftpLifetimeExpire(int fd, FtpData * data);
@@ -142,7 +142,7 @@ void ftpConnInProgress(int fd, FtpData * data);
 void ftpServerClose(void);
 
 /* External functions */
-extern char *base64_decode __P((char *coded));
+extern char *base64_decode _PARAMS((char *coded));
 
 static int
 ftpStateFree(int fd, FtpData * ftpState)
index 37916c0b1f81e6c44b0f8a18993a9cf1cbcaafff..158f771133a7b93533838f7910d829936145909d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.49 1996/09/18 21:39:32 wessels Exp $
+ * $Id: gopher.cc,v 1.50 1996/09/20 06:28:46 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -158,26 +158,26 @@ typedef struct gopher_ds {
     char *buf;                 /* pts to a 4k page */
 } GopherStateData;
 
-static int gopherStateFree __P((int fd, GopherStateData *));
-static void gopher_mime_content __P((char *buf, char *name, char *def));
-static void gopherMimeCreate __P((GopherStateData *));
+static int gopherStateFree _PARAMS((int fd, GopherStateData *));
+static void gopher_mime_content _PARAMS((char *buf, char *name, char *def));
+static void gopherMimeCreate _PARAMS((GopherStateData *));
 static int gopher_url_parser(char *url,
     char *host,
     int *port,
     char *type_id,
     char *request);
-static void gopherEndHTML __P((GopherStateData *));
-static void gopherToHTML __P((GopherStateData *, char *inbuf, int len));
-static int gopherReadReplyTimeout __P((int fd, GopherStateData *));
-static void gopherLifetimeExpire __P((int fd, GopherStateData *));
-static void gopherReadReply __P((int fd, GopherStateData *));
+static void gopherEndHTML _PARAMS((GopherStateData *));
+static void gopherToHTML _PARAMS((GopherStateData *, char *inbuf, int len));
+static int gopherReadReplyTimeout _PARAMS((int fd, GopherStateData *));
+static void gopherLifetimeExpire _PARAMS((int fd, GopherStateData *));
+static void gopherReadReply _PARAMS((int fd, GopherStateData *));
 static void gopherSendComplete(int fd,
     char *buf,
     int size,
     int errflag,
     void *data);
-static void gopherSendRequest __P((int fd, GopherStateData *));
-static GopherStateData *CreateGopherStateData __P((void));
+static void gopherSendRequest _PARAMS((int fd, GopherStateData *));
+static GopherStateData *CreateGopherStateData _PARAMS((void));
 
 static char def_gopher_bin[] = "www/unknown";
 static char def_gopher_text[] = "text/plain";
index 6a5e29c391d1c17ac003c039c118e9c13cf62994..20a22a1915fbc97906b969503e2cf43f2524e536 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.78 1996/09/18 21:39:33 wessels Exp $
+ * $Id: http.cc,v 1.79 1996/09/20 06:28:49 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -116,17 +116,17 @@ struct {
     int ctype;
 } ReplyHeaderStats;
 
-static int httpStateFree __P((int fd, HttpStateData *));
-static void httpReadReplyTimeout __P((int fd, HttpStateData *));
-static void httpLifetimeExpire __P((int fd, HttpStateData *));
-static void httpMakePublic __P((StoreEntry *));
-static void httpMakePrivate __P((StoreEntry *));
-static void httpCacheNegatively __P((StoreEntry *));
-static void httpReadReply __P((int fd, HttpStateData *));
-static void httpSendComplete __P((int fd, char *, int, int, void *));
-static void httpSendRequest __P((int fd, HttpStateData *));
-static void httpConnInProgress __P((int fd, HttpStateData *));
-static void httpConnect __P((int fd, struct hostent *, void *));
+static int httpStateFree _PARAMS((int fd, HttpStateData *));
+static void httpReadReplyTimeout _PARAMS((int fd, HttpStateData *));
+static void httpLifetimeExpire _PARAMS((int fd, HttpStateData *));
+static void httpMakePublic _PARAMS((StoreEntry *));
+static void httpMakePrivate _PARAMS((StoreEntry *));
+static void httpCacheNegatively _PARAMS((StoreEntry *));
+static void httpReadReply _PARAMS((int fd, HttpStateData *));
+static void httpSendComplete _PARAMS((int fd, char *, int, int, void *));
+static void httpSendRequest _PARAMS((int fd, HttpStateData *));
+static void httpConnInProgress _PARAMS((int fd, HttpStateData *));
+static void httpConnect _PARAMS((int fd, struct hostent *, void *));
 
 static int
 httpStateFree(int fd, HttpStateData * httpState)
@@ -635,7 +635,7 @@ httpSendRequest(int fd, HttpStateData * httpState)
        len += strlen(post_buf);
        xfree(post_buf);
     }
-    debug(11, 6, "httpSendRequest: FD %d: buf '%s'\n", fd, buf);
+    debug(11, 6, "httpSendRequest: FD %d:\n%s\n", fd, buf);
     comm_write(fd,
        buf,
        len,
index 83d6d94c0519f7af146bb854a52152781ec3eea1..e3d5a10be223c698156f6847ec4deba6bee48332 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.6 1996/09/17 16:32:40 wessels Exp $
+ * $Id: icmp.cc,v 1.7 1996/09/20 06:28:51 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -72,7 +72,7 @@ typedef struct _icmpQueueData {
     char *msg;
     int len;
     struct _icmpQueueData *next;
-    void (*free) __P((void *));
+    void (*free) _PARAMS((void *));
 } icmpQueueData;
 
 #define MAX_PAYLOAD (8192 - sizeof(struct icmphdr) - sizeof (char) - sizeof(struct timeval) - 1)
@@ -112,22 +112,22 @@ static char *icmpPktStr[] =
     "Out of Range Type"
 };
 
-static int in_cksum __P((unsigned short *ptr, int size));
-static void icmpRecv __P((int, void *));
-static void icmpQueueSend __P((struct in_addr,
+static int in_cksum _PARAMS((unsigned short *ptr, int size));
+static void icmpRecv _PARAMS((int, void *));
+static void icmpQueueSend _PARAMS((struct in_addr,
        char *msg,
        int len,
-       void          (*free) __P((void *))));
-static void icmpSend __P((int fd, icmpQueueData * queue));
-static void icmpLog __P((struct icmphdr * icmp,
+       void          (*free) _PARAMS((void *))));
+static void icmpSend _PARAMS((int fd, icmpQueueData * queue));
+static void icmpLog _PARAMS((struct icmphdr * icmp,
        struct in_addr addr,
        int rtt,
        int hops));
-static int ipHops __P((int ttl));
-static void icmpProcessReply __P((struct sockaddr_in * from,
+static int ipHops _PARAMS((int ttl));
+static void icmpProcessReply _PARAMS((struct sockaddr_in * from,
        struct icmphdr * icmp,
        int hops));
-static void icmpHandleSourcePing __P((struct sockaddr_in * from, char *buf));
+static void icmpHandleSourcePing _PARAMS((struct sockaddr_in * from, char *buf));
 
 void
 icmpOpen(void)
@@ -211,6 +211,7 @@ icmpProcessReply(struct sockaddr_in *from, struct icmphdr *icmp, int hops)
        icmpHandleSourcePing(from, echo->payload);
        break;
     case S_ICMP_DOM:
+       netdbHandlePingReply(from, hops, rtt);
        break;
     default:
        debug(37, 0, "icmpProcessReply: Bad opcode: %d\n", (int) echo->opcode);
@@ -282,7 +283,7 @@ static void
 icmpQueueSend(struct in_addr to,
     char *pkt,
     int len,
-    void (*free) __P((void *)))
+    void (*free) _PARAMS((void *)))
 {
     icmpQueueData *q = NULL;
     icmpQueueData **H = NULL;
index 357430fa9d8a33670e765e2ea3c0bae3b1011e22..ae71767a8fdf7b4ceb8189a625577358bf66f656 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ident.cc,v 1.15 1996/09/17 16:32:41 wessels Exp $
+ * $Id: ident.cc,v 1.16 1996/09/20 06:28:54 wessels Exp $
  *
  * DEBUG: section 30    Ident (RFC 931)
  * AUTHOR: Duane Wessels
@@ -32,9 +32,9 @@
 
 #define IDENT_PORT 113
 
-static void identRequestComplete __P((int, char *, int, int, void *));
-static void identReadReply __P((int, icpStateData *));
-static void identClose __P((int, icpStateData *));
+static void identRequestComplete _PARAMS((int, char *, int, int, void *));
+static void identReadReply _PARAMS((int, icpStateData *));
+static void identClose _PARAMS((int, icpStateData *));
 
 static void
 identClose(int fd, icpStateData * icpState)
index 6bc3bc0a3d87b1c8096a6cfc4db15ca4d8a51aae..e7080f566f5f9a5e5cdb469d8ee2beaecf53da72 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ipcache.cc,v 1.63 1996/09/18 21:39:36 wessels Exp $
+ * $Id: ipcache.cc,v 1.64 1996/09/20 06:28:55 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -134,30 +134,30 @@ static struct {
     int ghbn_calls;            /* # calls to blocking gethostbyname() */
 } IpcacheStats;
 
-static int ipcache_testname __P((void));
-static int ipcache_compareLastRef __P((ipcache_entry **, ipcache_entry **));
-static int ipcache_reverseLastRef __P((ipcache_entry **, ipcache_entry **));
-static int ipcache_dnsHandleRead __P((int, dnsserver_t *));
-static ipcache_entry *ipcache_parsebuffer __P((char *buf, dnsserver_t *));
-static void ipcache_release __P((ipcache_entry *));
-static ipcache_entry *ipcache_GetFirst __P((void));
-static ipcache_entry *ipcache_GetNext __P((void));
-static ipcache_entry *ipcache_create __P((void));
-static void ipcache_add_to_hash __P((ipcache_entry *));
-static void ipcache_call_pending __P((ipcache_entry *));
-static void ipcache_add __P((char *, ipcache_entry *, struct hostent *, int));
-static int ipcacheHasPending __P((ipcache_entry *));
-static ipcache_entry *ipcache_get __P((char *));
-static void dummy_handler __P((int, struct hostent * hp, void *));
-static int ipcacheExpiredEntry __P((ipcache_entry *));
-static void ipcacheAddPending __P((ipcache_entry *, int fd, IPH, void *));
-static void ipcacheEnqueue __P((ipcache_entry *));
-static void *ipcacheDequeue __P((void));
-static void ipcache_dnsDispatch __P((dnsserver_t *, ipcache_entry *));
-static struct hostent *ipcacheCheckNumeric __P((char *name));
-static void ipcacheStatPrint __P((ipcache_entry *, StoreEntry *));
-static void ipcacheUnlockEntry __P((ipcache_entry *));
-static void ipcacheLockEntry __P((ipcache_entry *));
+static int ipcache_testname _PARAMS((void));
+static int ipcache_compareLastRef _PARAMS((ipcache_entry **, ipcache_entry **));
+static int ipcache_reverseLastRef _PARAMS((ipcache_entry **, ipcache_entry **));
+static int ipcache_dnsHandleRead _PARAMS((int, dnsserver_t *));
+static ipcache_entry *ipcache_parsebuffer _PARAMS((char *buf, dnsserver_t *));
+static void ipcache_release _PARAMS((ipcache_entry *));
+static ipcache_entry *ipcache_GetFirst _PARAMS((void));
+static ipcache_entry *ipcache_GetNext _PARAMS((void));
+static ipcache_entry *ipcache_create _PARAMS((void));
+static void ipcache_add_to_hash _PARAMS((ipcache_entry *));
+static void ipcache_call_pending _PARAMS((ipcache_entry *));
+static void ipcache_add _PARAMS((char *, ipcache_entry *, struct hostent *, int));
+static int ipcacheHasPending _PARAMS((ipcache_entry *));
+static ipcache_entry *ipcache_get _PARAMS((char *));
+static void dummy_handler _PARAMS((int, struct hostent * hp, void *));
+static int ipcacheExpiredEntry _PARAMS((ipcache_entry *));
+static void ipcacheAddPending _PARAMS((ipcache_entry *, int fd, IPH, void *));
+static void ipcacheEnqueue _PARAMS((ipcache_entry *));
+static void *ipcacheDequeue _PARAMS((void));
+static void ipcache_dnsDispatch _PARAMS((dnsserver_t *, ipcache_entry *));
+static struct hostent *ipcacheCheckNumeric _PARAMS((char *name));
+static void ipcacheStatPrint _PARAMS((ipcache_entry *, StoreEntry *));
+static void ipcacheUnlockEntry _PARAMS((ipcache_entry *));
+static void ipcacheLockEntry _PARAMS((ipcache_entry *));
 
 static struct hostent *static_result = NULL;
 static HashID ip_table = 0;
@@ -929,8 +929,10 @@ stat_ipcache_get(StoreEntry * sentry)
     N = 0;
     for (i = ipcache_GetFirst(); i; i = ipcache_GetNext()) {
        *(list + N) = i;
-       if (++N > meta_data.ipcache_count)
-           fatal_dump("stat_ipcache_get: meta_data.ipcache_count mismatch");
+       if (++N > meta_data.ipcache_count) {
+           debug_trap("stat_ipcache_get: meta_data.ipcache_count mismatch");
+           break;
+       }
     }
     qsort((char *) list,
        N,
@@ -939,6 +941,7 @@ stat_ipcache_get(StoreEntry * sentry)
     for (k = 0; k < N; k++)
        ipcacheStatPrint(*(list + k), sentry);
     storeAppendPrintf(sentry, close_bracket);
+    xfree(list);
 }
 
 static void
index 52416a1123f885e65c9ef0254aff51646765fd8d..f2b9c9a39e926555f40186ef8fc7d86faee6d4a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.cc,v 1.82 1996/09/18 21:39:37 wessels Exp $
+ * $Id: main.cc,v 1.83 1996/09/20 06:28:56 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -133,9 +133,9 @@ struct in_addr local_addr;
 char *dash_str = "-";
 
 /* for error reporting from xmalloc and friends */
-extern void (*failure_notify) __P((char *));
+extern void (*failure_notify) _PARAMS((char *));
 
-volatile static int rotate_pending = 0;                /* set by SIGUSR1 handler */
+static volatile int rotate_pending = 0;                /* set by SIGUSR1 handler */
 static int httpPortNumOverride = 1;
 static int icpPortNumOverride = 1;     /* Want to detect "-u 0" */
 #if MALLOC_DBG
@@ -148,14 +148,14 @@ static time_t next_dirclean;
 static time_t next_announce;
 static time_t next_ip_purge;
 
-static void rotate_logs __P((int));
-static void reconfigure __P((int));
-static void mainInitialize __P((void));
-static void mainReinitialize __P((void));
-static time_t mainMaintenance __P((void));
-static void usage __P((void));
-static void mainParseOptions __P((int, char **));
-static void sendSignal __P((void));
+static void rotate_logs _PARAMS((int));
+static void reconfigure _PARAMS((int));
+static void mainInitialize _PARAMS((void));
+static void mainReinitialize _PARAMS((void));
+static time_t mainMaintenance _PARAMS((void));
+static void usage _PARAMS((void));
+static void mainParseOptions _PARAMS((int, char **));
+static void sendSignal _PARAMS((void));
 
 static void
 usage(void)
@@ -384,6 +384,7 @@ serverConnectionsOpen(void)
     }
 #if USE_ICMP
     icmpOpen();
+    netdbInit();
 #endif
 }
 
index 99d23675529c7175de54c8d79e8bf67100de7cfa..912bd40295a44e2d321ca57b40fc85780f905d12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.56 1996/09/18 21:39:37 wessels Exp $
+ * $Id: neighbors.cc,v 1.57 1996/09/20 06:28:58 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
 
 #include "squid.h"
 
-static int edgeWouldBePinged __P((edge *, request_t *));
-static void neighborRemove __P((edge *));
-static edge *whichEdge __P((icp_common_t *, struct sockaddr_in *));
+static int edgeWouldBePinged _PARAMS((edge *, request_t *));
+static void neighborRemove _PARAMS((edge *));
+static edge *whichEdge _PARAMS((icp_common_t *, struct sockaddr_in *));
 
 static neighbors *friends = NULL;
 static struct neighbor_cf *Neighbor_cf = NULL;
index f10ec4ca13b83e15765fba4cbee085dca7e8d2a0..111e53828ceed1a5b0059ca60640a0773a8714ac 100644 (file)
 
+#if USE_ICMP
+
 #include "squid.h"
 
-#define NET_DB_TTL 3600
+#define NET_DB_TTL 5
+
+static HashID addr_table;
+static HashID host_table;
 
-static HashID table;
+static struct in_addr networkFromInaddr _PARAMS((struct in_addr a));
+
+void
+netdbInit(void)
+{
+    addr_table = hash_create(strcmp, 229, hash_string);
+    host_table = hash_create(strcmp, 467, hash_string);
+}
 
 static void
-netdbHashInsert(netdbEntry * n, char *key)
+netdbHashInsert(netdbEntry * n, struct in_addr addr)
 {
-    hash_insert(table, key, n);
+    strncpy(n->network, inet_ntoa(networkFromInaddr(addr)), 15);
+    n->key = n->network;
+    hash_join(addr_table, (hash_link *) n);
     meta_data.netdb++;
-    n->link_count++;
 }
 
 static void
-netdbHashDelete(netdbEntry * n, char *key)
+netdbHashDelete(struct in_addr addr)
 {
-    hash_link *hptr = hash_lookup(table, key);
+    char *key = inet_ntoa(networkFromInaddr(addr));
+    hash_link *hptr = hash_lookup(addr_table, key);
     if (hptr == NULL) {
        debug_trap("netdbHashDelete: key not found");
        return;
     }
-    hash_delete_link(table, hptr);
+    hash_delete_link(addr_table, hptr);
+    meta_data.netdb--;
+}
+
+static void
+netdbHashLink(netdbEntry * n, char *hostname)
+{
+    struct _net_db_name *x = xcalloc(1, sizeof(struct _net_db_name));
+    x->name = xstrdup(hostname);
+    x->next = n->hosts;
+    n->hosts = x;
+    hash_insert(host_table, x->name, n);
+    n->link_count++;
+}
+
+static void
+netdbHashUnlink(char *key)
+{
+    netdbEntry *n;
+    hash_link *hptr = hash_lookup(host_table, key);
+    if (hptr == NULL) {
+       debug_trap("netdbHashUnlink: key not found");
+       return;
+    }
+    hash_delete(host_table, hptr);
     meta_data.netdb--;
+    n = (netdbEntry *) hptr->item;
     n->link_count--;
 }
 
 static netdbEntry *
-netdbCreate(char *network)
+netdbLookupHost(char *key)
 {
-    netdbEntry *n = xcalloc(1, sizeof(netdbEntry));
-    strncpy(n->network, network, 15);
-    n->expires = squid_curtime + NET_DB_TTL;
-    return n;
+    hash_link *hptr = hash_lookup(host_table, key);
+    return hptr ? (netdbEntry *) hptr->item : NULL;
 }
 
-netdbEntry *
-netdbLookup(char *key)
+static netdbEntry *
+netdbLookupAddr(struct in_addr addr)
 {
-    hash_link *hptr = hash_lookup(table, key);
-    return hptr ? (netdbEntry *) hptr->item : NULL;
+    char *key = inet_ntoa(networkFromInaddr(addr));
+    return (netdbEntry *) hash_lookup(addr_table, key);
 }
 
-static void
-netdbAdd(int fdunused, struct hostent *hp, void *data)
+static netdbEntry *
+netdbAdd(struct in_addr addr, char *hostname)
 {
     netdbEntry *n;
-    LOCAL_ARRAY(char, network, 16);
-    char *hostname = data;
-    if (hp == NULL)
-       return;
-    strcpy(network, inet_ntoa(inaddrFromHostent(hp)));
-    if ((n = netdbLookup(network)) == NULL) {
-       n = netdbCreate(network);
-       netdbHashInsert(n, network);
+    if ((n = netdbLookupAddr(addr)) == NULL) {
+       n = xcalloc(1, sizeof(netdbEntry));
+       netdbHashInsert(n, addr);
     }
-    netdbHashInsert(n, hostname);
-    xfree(hostname);
+    netdbHashLink(n, hostname);
+    return n;
 }
 
 static void
-netdbMaybeAdd(char *hostname)
+netdbSendPing(int fdunused, struct hostent *hp, void *data)
 {
+    struct in_addr addr;
+    char *hostname = data;
     netdbEntry *n;
-    if ((n = netdbLookup(hostname)) != NULL)
+    if (hp == NULL)
        return;
+    addr = inaddrFromHostent(hp);
+    if ((n = netdbLookupHost(hostname)) == NULL)
+       n = netdbAdd(addr, hostname);
+    debug(37, 0, "netdbSendPing: pinging %s\n", hostname);
+    icmpDomainPing(addr, hostname);
+    n->next_ping_time = squid_curtime + NET_DB_TTL;
+    xfree(hostname);
+}
+
+void
+netdbPingSite(char *hostname)
+{
     ipcache_nbgethostbyname(hostname,
        -1,
-       netdbAdd,
+       netdbSendPing,
        (void *) xstrdup(hostname));
 }
+
+void
+netdbHandlePingReply(struct sockaddr_in *from, int hops, int rtt)
+{
+    netdbEntry *n;
+    int N;
+    debug(37, 0, "netdbHandlePingReply: from %s\n", inet_ntoa(from->sin_addr));
+    if ((n = netdbLookupAddr(from->sin_addr)) == NULL)
+       return;
+    N = ++n->n;
+    if (N > 100)
+       N = 100;
+    n->hops = ((n->hops * (N - 1)) + hops) / N;
+    n->rtt = ((n->rtt * (N - 1)) + rtt) / N;
+    debug(37, 0, "netdbHandlePingReply: %s; rtt=%5.1f  hops=%4.1f\n",
+       n->network,
+       n->rtt,
+       n->hops);
+}
+
+static struct in_addr
+networkFromInaddr(struct in_addr a)
+{
+    struct in_addr b = a;
+    if (IN_CLASSC(b.s_addr))
+       b.s_addr &= IN_CLASSC_NET;
+    else if (IN_CLASSB(b.s_addr))
+       b.s_addr &= IN_CLASSB_NET;
+    else if (IN_CLASSA(b.s_addr))
+       b.s_addr &= IN_CLASSA_NET;
+    return b;
+}
+
+static int
+sortByHops(netdbEntry ** n1, netdbEntry ** n2)
+{
+    if ((*n1)->hops > (*n2)->hops)
+       return 1;
+    else if ((*n1)->hops < (*n2)->hops)
+       return -1;
+    else
+       return 0;
+}
+
+void
+netdbDump(StoreEntry * sentry)
+{
+    netdbEntry *n;
+    netdbEntry **list;
+    struct _net_db_name *x;
+    int k;
+    int i;
+    storeAppendPrintf(sentry, "{Network DB Statistics:\n");
+    storeAppendPrintf(sentry, "{%-16.16s %7s %5s %s}\n",
+       "Network",
+       "RTT",
+       "Hops",
+       "Hostnames");
+    list = xcalloc(meta_data.netdb, sizeof(netdbEntry *));
+    n = (netdbEntry *) hash_first(addr_table);
+    i = 0;
+    while (n) {
+       *(list + i++) = n;
+       n = (netdbEntry *) hash_next(addr_table);
+    }
+    qsort((char *) list,
+       i,
+       sizeof(netdbEntry *),
+       (QS) sortByHops);
+    for (k = 0; k < i; k++) {
+       n = *(list + k);
+       storeAppendPrintf(sentry, "{%-16.16s %7.1f %5.1f",
+           n->network,
+           n->rtt,
+           n->hops);
+       for (x = n->hosts; x; x = x->next)
+           storeAppendPrintf(sentry, " %s", x->name);
+       storeAppendPrintf(sentry, close_bracket);
+    }
+    storeAppendPrintf(sentry, close_bracket);
+    xfree(list);
+}
+
+#endif /* USE_ICMP */
index ff78350a69aa8008a63d20d51267a2504a43184f..d00b6d54ab02330a550e42759622b36d95ab1019 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: recv-announce.cc,v 1.9 1996/09/17 02:30:01 wessels Exp $
+ * $Id: recv-announce.cc,v 1.10 1996/09/20 06:29:04 wessels Exp $
  *
  * DEBUG: section 0     Announement Server
  * AUTHOR: Harvest Derived
 
 #define RECV_BUF_SIZE 8192
 
-extern void xmemcpy __P((void *from, void *to, int len));
+extern void xmemcpy _PARAMS((void *from, void *to, int len));
 
 /*
  * This program must be run from inetd.  First add something like this
index 772afae69f05b76d13b21ed07b8e6615f27a2b02..7be0585c69088fac3367e06cd7dbb7b48213e7bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.18 1996/09/17 02:30:02 wessels Exp $
+ * $Id: redirect.cc,v 1.19 1996/09/20 06:29:05 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -70,12 +70,12 @@ struct redirectQueueData {
     redirectStateData *redirectState;
 };
 
-static redirector_t *GetFirstAvailable __P((void));
-static int redirectCreateRedirector __P((char *command));
-static int redirectHandleRead __P((int, redirector_t *));
-static redirectStateData *Dequeue __P((void));
-static void Enqueue __P((redirectStateData *));
-static void redirectDispatch __P((redirector_t *, redirectStateData *));
+static redirector_t *GetFirstAvailable _PARAMS((void));
+static int redirectCreateRedirector _PARAMS((char *command));
+static int redirectHandleRead _PARAMS((int, redirector_t *));
+static redirectStateData *Dequeue _PARAMS((void));
+static void Enqueue _PARAMS((redirectStateData *));
+static void redirectDispatch _PARAMS((redirector_t *, redirectStateData *));
 
 
 static redirector_t **redirect_child_table = NULL;
@@ -284,7 +284,7 @@ redirectDispatch(redirector_t * redirect, redirectStateData * r)
     sprintf(buf, "%s %s/%s %s %s\n",
        r->orig_url,
        inet_ntoa(r->client_addr),
-       dash_str,
+       fqdn,
        r->client_ident,
        r->method_s);
     len = strlen(buf);
index 27f3e720ba66cb3dc9583c8c53979de5d6a52859..b96cfe9827140a638ffceb5ec40d13c4f599de08 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.56 1996/09/18 22:44:51 wessels Exp $
+ * $Id: squid.h,v 1.57 1996/09/20 06:29:06 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
 #include <aio.h>
 #endif
 
-#if __STDC__ 
+#if __STDC__
 #include <stdarg.h>
 #else
 #include <varargs.h>
@@ -259,8 +259,8 @@ typedef int (*QS) (const void *, const void *);
 #include "tempnam.h"
 #endif
 
-extern void serverConnectionsClose __P((void));
-extern void shut_down __P((int));
+extern void serverConnectionsClose _PARAMS((void));
+extern void shut_down _PARAMS((int));
 
 
 extern time_t squid_starttime; /* main.c */
@@ -294,14 +294,14 @@ extern int opt_forwarded_for;     /* main.c */
 
 #define  CONNECT_PORT        443
 
-extern int objcacheStart __P((int, char *, StoreEntry *));
-extern void send_announce __P((void));
-extern int sslStart __P((int fd, char *, request_t *, char *, int *sz));
-extern char *storeToString __P((StoreEntry *));
-extern void ttlSet __P((StoreEntry *));
-extern void ttlFreeList __P((void));
-extern void ttlAddToList __P((char *, int, int, time_t, int, time_t));
-extern void ttlAddToForceList __P((char *, time_t, time_t));
-extern int waisStart __P((int, char *, method_t, char *, StoreEntry *));
-extern void storeDirClean __P((void));
+extern int objcacheStart _PARAMS((int, char *, StoreEntry *));
+extern void send_announce _PARAMS((void));
+extern int sslStart _PARAMS((int fd, char *, request_t *, char *, int *sz));
+extern char *storeToString _PARAMS((StoreEntry *));
+extern void ttlSet _PARAMS((StoreEntry *));
+extern void ttlFreeList _PARAMS((void));
+extern void ttlAddToList _PARAMS((char *, int, int, time_t, int, time_t));
+extern void ttlAddToForceList _PARAMS((char *, time_t, time_t));
+extern int waisStart _PARAMS((int, char *, method_t, char *, StoreEntry *));
+extern void storeDirClean _PARAMS((void));
 extern char *dash_str;
index d2f060b8b296e683a55a6f29bcba2587d23f793e..2351d4fb5885ff7658f02e9200da3fdc0f5688e0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.17 1996/09/18 20:12:22 wessels Exp $
+ * $Id: ssl.cc,v 1.18 1996/09/20 06:29:07 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -49,19 +49,19 @@ typedef struct {
 
 static char conn_established[] = "HTTP/1.0 200 Connection established\r\n\r\n";
 
-static void sslLifetimeExpire __P((int fd, SslStateData * sslState));
-static void sslReadTimeout __P((int fd, SslStateData * sslState));
-static void sslReadServer __P((int fd, SslStateData * sslState));
-static void sslReadClient __P((int fd, SslStateData * sslState));
-static void sslWriteServer __P((int fd, SslStateData * sslState));
-static void sslWriteClient __P((int fd, SslStateData * sslState));
-static void sslConnected __P((int fd, SslStateData * sslState));
-static void sslProxyConnected __P((int fd, SslStateData * sslState));
-static void sslConnect __P((int fd, struct hostent *, void *));
-static void sslConnInProgress __P((int fd, SslStateData * sslState));
-static void sslErrorComplete __P((int, char *, int, int, void *));
-static void sslClose __P((SslStateData * sslState));
-static int sslClientClosed __P((int fd, SslStateData * sslState));
+static void sslLifetimeExpire _PARAMS((int fd, SslStateData * sslState));
+static void sslReadTimeout _PARAMS((int fd, SslStateData * sslState));
+static void sslReadServer _PARAMS((int fd, SslStateData * sslState));
+static void sslReadClient _PARAMS((int fd, SslStateData * sslState));
+static void sslWriteServer _PARAMS((int fd, SslStateData * sslState));
+static void sslWriteClient _PARAMS((int fd, SslStateData * sslState));
+static void sslConnected _PARAMS((int fd, SslStateData * sslState));
+static void sslProxyConnected _PARAMS((int fd, SslStateData * sslState));
+static void sslConnect _PARAMS((int fd, struct hostent *, void *));
+static void sslConnInProgress _PARAMS((int fd, SslStateData * sslState));
+static void sslErrorComplete _PARAMS((int, char *, int, int, void *));
+static void sslClose _PARAMS((SslStateData * sslState));
+static int sslClientClosed _PARAMS((int fd, SslStateData * sslState));
 
 static void
 sslClose(SslStateData * sslState)
index ae0fa65a36abf5cde43fd2af352eeafdfe66f313..c9ed0f0cde66cf50c33c86cc214d9c33d8570059 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.73 1996/09/18 20:12:23 wessels Exp $
+ * $Id: stat.cc,v 1.74 1996/09/20 06:29:09 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -123,50 +123,49 @@ Meta_data meta_data;
 volatile unsigned long ntcpconn = 0;
 volatile unsigned long nudpconn = 0;
 struct _iostats IOStats;
-
-char *stat_describe();
-char *mem_describe();
-char *ttl_describe();
-char *flags_describe();
-char *elapsed_time();
-char *diskFileName();
-
-/* LOCALS */
 char *open_bracket = "{\n";
 char *close_bracket = "}\n";
 
-static void dummyhandler __P((cacheinfo *, StoreEntry *));
-static void info_get __P((cacheinfo *, StoreEntry *));
-static void logReadEndHandler __P((int, int, log_read_data_t *));
-static void log_clear __P((cacheinfo *, StoreEntry *));
-static void log_disable __P((cacheinfo *, StoreEntry *));
-static void log_enable __P((cacheinfo *, StoreEntry *));
-static void log_get_start __P((cacheinfo *, StoreEntry *));
-static void log_status_get __P((cacheinfo *, StoreEntry *));
-static void parameter_get __P((cacheinfo *, StoreEntry *));
-static void proto_count __P((cacheinfo *, protocol_t, log_type));
-static void proto_newobject __P((cacheinfo *, protocol_t, int, int));
-static void proto_purgeobject __P((cacheinfo *, protocol_t, int));
-static void proto_touchobject __P((cacheinfo *, protocol_t, int));
-static void server_list __P((cacheinfo *, StoreEntry *));
-static void squidReadEndHandler __P((int, int, squid_read_data_t *));
-static void squid_get_start __P((cacheinfo *, StoreEntry *));
-static void statFiledescriptors __P((StoreEntry *));
-static void stat_get __P((cacheinfo *, char *req, StoreEntry *));
-static void stat_io_get __P((StoreEntry *));
-static void stat_objects_get __P((cacheinfo *, StoreEntry *, int vm_or_not));
-static void stat_utilization_get __P((cacheinfo *, StoreEntry *, char *desc));
-static int cache_size_get __P((cacheinfo *));
-static int logReadHandler __P((int, char *, int, log_read_data_t *));
-static int squidReadHandler __P((int, char *, int, squid_read_data_t *));
-static int memoryAccounted __P((void));
+extern char *diskFileName _PARAMS((int));
+
+/* LOCALS */
+static char *stat_describe _PARAMS((StoreEntry * entry));
+static char *mem_describe _PARAMS((StoreEntry * entry));
+static char *ttl_describe _PARAMS((StoreEntry * entry));
+static char *flags_describe _PARAMS((StoreEntry * entry));
+static char *elapsed_time _PARAMS((StoreEntry * entry, int since, char *TTL));
+static void dummyhandler _PARAMS((cacheinfo *, StoreEntry *));
+static void info_get _PARAMS((cacheinfo *, StoreEntry *));
+static void logReadEndHandler _PARAMS((int, int, log_read_data_t *));
+static void log_clear _PARAMS((cacheinfo *, StoreEntry *));
+static void log_disable _PARAMS((cacheinfo *, StoreEntry *));
+static void log_enable _PARAMS((cacheinfo *, StoreEntry *));
+static void log_get_start _PARAMS((cacheinfo *, StoreEntry *));
+static void log_status_get _PARAMS((cacheinfo *, StoreEntry *));
+static void parameter_get _PARAMS((cacheinfo *, StoreEntry *));
+static void proto_count _PARAMS((cacheinfo *, protocol_t, log_type));
+static void proto_newobject _PARAMS((cacheinfo *, protocol_t, int, int));
+static void proto_purgeobject _PARAMS((cacheinfo *, protocol_t, int));
+static void proto_touchobject _PARAMS((cacheinfo *, protocol_t, int));
+static void server_list _PARAMS((cacheinfo *, StoreEntry *));
+static void squidReadEndHandler _PARAMS((int, int, squid_read_data_t *));
+static void squid_get_start _PARAMS((cacheinfo *, StoreEntry *));
+static void statFiledescriptors _PARAMS((StoreEntry *));
+static void stat_get _PARAMS((cacheinfo *, char *req, StoreEntry *));
+static void stat_io_get _PARAMS((StoreEntry *));
+static void stat_objects_get _PARAMS((cacheinfo *, StoreEntry *, int vm_or_not));
+static void stat_utilization_get _PARAMS((cacheinfo *, StoreEntry *, char *desc));
+static int cache_size_get _PARAMS((cacheinfo *));
+static int logReadHandler _PARAMS((int, char *, int, log_read_data_t *));
+static int squidReadHandler _PARAMS((int, char *, int, squid_read_data_t *));
+static int memoryAccounted _PARAMS((void));
 
 #ifdef UNUSED_CODE
-static int mallinfoTotal __P((void));
+static int mallinfoTotal _PARAMS((void));
 #endif
 
 #ifdef XMALLOC_STATISTICS
-static void info_get_mallstat __P((int, int, StoreEntry *));
+static void info_get_mallstat _PARAMS((int, int, StoreEntry *));
 #endif
 
 /* process utilization information */
@@ -378,6 +377,10 @@ stat_get(cacheinfo * obj, char *req, StoreEntry * sentry)
        httpReplyHeaderStats(sentry);
     } else if (strcmp(req, "filedescriptors") == 0) {
        statFiledescriptors(sentry);
+#if USE_ICMP
+    } else if (strcmp(req, "netdb") == 0) {
+       netdbDump(sentry);
+#endif
     }
 }
 
@@ -1267,7 +1270,7 @@ stat_init(cacheinfo ** object, char *logfilename)
     *object = obj;
 }
 
-char *
+static char *
 stat_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, state, 256);
@@ -1279,7 +1282,7 @@ stat_describe(StoreEntry * entry)
     return (state);
 }
 
-char *
+static char *
 mem_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, where, 100);
@@ -1293,7 +1296,7 @@ mem_describe(StoreEntry * entry)
 }
 
 
-char *
+static char *
 ttl_describe(StoreEntry * entry)
 {
     int hh, mm, ss;
@@ -1318,7 +1321,7 @@ ttl_describe(StoreEntry * entry)
     return (TTL);
 }
 
-char *
+static char *
 elapsed_time(StoreEntry * entry, int since, char *TTL)
 {
     int hh, mm, ss, ttl;
@@ -1342,7 +1345,7 @@ elapsed_time(StoreEntry * entry, int since, char *TTL)
 }
 
 
-char *
+static char *
 flags_describe(StoreEntry * entry)
 {
     LOCAL_ARRAY(char, FLAGS, 32);
index db30c5c6ecb1425f0c1d9523cbeaba8ad4b1ce6b..d04cd8f655c9f7050913854f29cd4975622f83f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stmem.cc,v 1.25 1996/09/18 21:41:08 wessels Exp $
+ * $Id: stmem.cc,v 1.26 1996/09/20 06:29:11 wessels Exp $
  *
  * DEBUG: section 19    Memory Primitives
  * AUTHOR: Harvest Derived
@@ -116,8 +116,8 @@ stmem_stats mem_obj_pool;
 #define USE_MEMALIGN 0
 #endif
 
-static void *get_free_thing __P((stmem_stats * thing));
-static void put_free_thing __P((stmem_stats * thing, void *p));
+static void *get_free_thing _PARAMS((stmem_stats * thing));
+static void put_free_thing _PARAMS((stmem_stats * thing, void *p));
 
 
 void
@@ -377,8 +377,7 @@ put_free_thing(stmem_stats * thing, void *p)
 }
 
 void
-put_free_request_t(req)
-     void *req;
+put_free_request_t(void *req)
 {
     put_free_thing(&request_pool, req);
 }
index aed7a1063e5bb8cd8f701e949b27ed17ccd2cc8e..c1e943bdccefb8322942643dedbd01614eec2d0b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.116 1996/09/18 22:44:53 wessels Exp $
+ * $Id: store.cc,v 1.117 1996/09/20 06:29:13 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -202,25 +202,25 @@ struct storeRebuild_data {
 int store_rebuilding = STORE_REBUILDING_SLOW;
 
 /* Static Functions */
-static int storeSwapInStart __P((StoreEntry *, SIH, void *));
-static void destroy_MemObject __P((MemObject *));
-static void destroy_MemObjectData __P((MemObject *));
-static void destroy_StoreEntry __P((StoreEntry *));
-static MemObject *new_MemObject __P((void));
-static mem_ptr new_MemObjectData __P((void));
-static StoreEntry *new_StoreEntry __P((int mem_obj_flag));
-static int storeCheckPurgeMem __P((StoreEntry * e));
-static int storeCheckExpired __P((StoreEntry * e));
-static void storeSwapLog __P((StoreEntry *));
-static int storeHashDelete __P((StoreEntry *));
-static char *storeDescribeStatus __P((StoreEntry *));
-static int compareLastRef __P((StoreEntry ** e1, StoreEntry ** e2));
-static int compareSize __P((StoreEntry ** e1, StoreEntry ** e2));
-static int storeClientListSearch __P((MemObject *, int fd));
-static void storeHashMemInsert __P((StoreEntry *));
-static void storeHashMemDelete __P((StoreEntry *));
-static int storeCopy __P((StoreEntry *, int, int, char *, int *));
-static int storeGetMemSpace __P((int size));
+static int storeSwapInStart _PARAMS((StoreEntry *, SIH, void *));
+static void destroy_MemObject _PARAMS((MemObject *));
+static void destroy_MemObjectData _PARAMS((MemObject *));
+static void destroy_StoreEntry _PARAMS((StoreEntry *));
+static MemObject *new_MemObject _PARAMS((void));
+static mem_ptr new_MemObjectData _PARAMS((void));
+static StoreEntry *new_StoreEntry _PARAMS((int mem_obj_flag));
+static int storeCheckPurgeMem _PARAMS((StoreEntry * e));
+static int storeCheckExpired _PARAMS((StoreEntry * e));
+static void storeSwapLog _PARAMS((StoreEntry *));
+static int storeHashDelete _PARAMS((StoreEntry *));
+static char *storeDescribeStatus _PARAMS((StoreEntry *));
+static int compareLastRef _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
+static int compareSize _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
+static int storeClientListSearch _PARAMS((MemObject *, int fd));
+static void storeHashMemInsert _PARAMS((StoreEntry *));
+static void storeHashMemDelete _PARAMS((StoreEntry *));
+static int storeCopy _PARAMS((StoreEntry *, int, int, char *, int *));
+static int storeGetMemSpace _PARAMS((int size));
 
 /* Now, this table is inaccessible to outsider. They have to use a method
  * to access a value in internal storage data structure. */
@@ -1023,7 +1023,7 @@ storeAppend(StoreEntry * e, char *data, int len)
        InvokeHandlers(e);
 }
 
-#if __STDC__ 
+#if __STDC__
 void
 storeAppendPrintf(StoreEntry * e, char *fmt,...)
 {
index 7cf44c908176cef69d82331cfaa3a483db6c9b97..d08f3e09fde8a17f6c767ee5900573e21e88e1c9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.61 1996/09/17 16:32:49 wessels Exp $
+ * $Id: tools.cc,v 1.62 1996/09/20 06:29:17 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -594,7 +594,7 @@ percent(int a, int b)
 }
 
 void
-squid_signal(int sig, void (*func) (), int flags)
+squid_signal(int sig, void (*func) _PARAMS((int)), int flags)
 {
 #if HAVE_SIGACTION
     struct sigaction sa;
index 1aeff8ebf6e44e2795a13d130da3f4bedabd9a40..cd92e41c907c66a6dc3ff6736f678eea740b328b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.17 1996/09/18 20:12:22 wessels Exp $
+ * $Id: tunnel.cc,v 1.18 1996/09/20 06:29:07 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -49,19 +49,19 @@ typedef struct {
 
 static char conn_established[] = "HTTP/1.0 200 Connection established\r\n\r\n";
 
-static void sslLifetimeExpire __P((int fd, SslStateData * sslState));
-static void sslReadTimeout __P((int fd, SslStateData * sslState));
-static void sslReadServer __P((int fd, SslStateData * sslState));
-static void sslReadClient __P((int fd, SslStateData * sslState));
-static void sslWriteServer __P((int fd, SslStateData * sslState));
-static void sslWriteClient __P((int fd, SslStateData * sslState));
-static void sslConnected __P((int fd, SslStateData * sslState));
-static void sslProxyConnected __P((int fd, SslStateData * sslState));
-static void sslConnect __P((int fd, struct hostent *, void *));
-static void sslConnInProgress __P((int fd, SslStateData * sslState));
-static void sslErrorComplete __P((int, char *, int, int, void *));
-static void sslClose __P((SslStateData * sslState));
-static int sslClientClosed __P((int fd, SslStateData * sslState));
+static void sslLifetimeExpire _PARAMS((int fd, SslStateData * sslState));
+static void sslReadTimeout _PARAMS((int fd, SslStateData * sslState));
+static void sslReadServer _PARAMS((int fd, SslStateData * sslState));
+static void sslReadClient _PARAMS((int fd, SslStateData * sslState));
+static void sslWriteServer _PARAMS((int fd, SslStateData * sslState));
+static void sslWriteClient _PARAMS((int fd, SslStateData * sslState));
+static void sslConnected _PARAMS((int fd, SslStateData * sslState));
+static void sslProxyConnected _PARAMS((int fd, SslStateData * sslState));
+static void sslConnect _PARAMS((int fd, struct hostent *, void *));
+static void sslConnInProgress _PARAMS((int fd, SslStateData * sslState));
+static void sslErrorComplete _PARAMS((int, char *, int, int, void *));
+static void sslClose _PARAMS((SslStateData * sslState));
+static int sslClientClosed _PARAMS((int fd, SslStateData * sslState));
 
 static void
 sslClose(SslStateData * sslState)
index 40f58bf3d892a7f909bcdb9fa27f681fb21c67ac..260c005adb2bd9f95869d84e2151fdd053a74a15 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.43 1996/09/18 20:12:25 wessels Exp $
+ * $Id: wais.cc,v 1.44 1996/09/20 06:29:19 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -118,14 +118,14 @@ typedef struct {
     char request[MAX_URL + 1];
 } WaisStateData;
 
-static int waisStateFree __P((int, WaisStateData *));
-static void waisReadReplyTimeout __P((int, WaisStateData *));
-static void waisLifetimeExpire __P((int, WaisStateData *));
-static void waisReadReply __P((int, WaisStateData *));
-static void waisSendComplete __P((int, char *, int, int, void *));
-static void waisSendRequest __P((int, WaisStateData *));
-static void waisConnInProgress __P((int, WaisStateData *));
-static void waisConnect __P((int, struct hostent *, void *));
+static int waisStateFree _PARAMS((int, WaisStateData *));
+static void waisReadReplyTimeout _PARAMS((int, WaisStateData *));
+static void waisLifetimeExpire _PARAMS((int, WaisStateData *));
+static void waisReadReply _PARAMS((int, WaisStateData *));
+static void waisSendComplete _PARAMS((int, char *, int, int, void *));
+static void waisSendRequest _PARAMS((int, WaisStateData *));
+static void waisConnInProgress _PARAMS((int, WaisStateData *));
+static void waisConnect _PARAMS((int, struct hostent *, void *));
 
 static int
 waisStateFree(int fd, WaisStateData * waisState)