From: wessels <> Date: Fri, 20 Sep 1996 12:28:12 +0000 (+0000) Subject: - Fixed coredump in icpStateFree() when calling X-Git-Tag: SQUID_3_0_PRE1~5761 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67508012c81242770491cc6732a8a5b5e9715391;p=thirdparty%2Fsquid.git - 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. --- diff --git a/ChangeLog b/ChangeLog index 48f7d221ac..636606e997 100644 --- 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. diff --git a/include/tempnam.h b/include/tempnam.h index a62c1dbe4c..e69219fe95 100644 --- a/include/tempnam.h +++ b/include/tempnam.h @@ -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 */ diff --git a/include/util.h b/include/util.h index 34e21f9da5..565d51893c 100644 --- a/include/util.h +++ b/include/util.h @@ -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 * @@ -122,23 +122,23 @@ #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_ */ diff --git a/lib/base64.c b/lib/base64.c index 4a6ad7c3e1..64bd761407 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -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]; diff --git a/lib/util.c b/lib/util.c index 93d7e96269..1616b9ef38 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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 @@ -130,7 +130,7 @@ #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; diff --git a/src/Makefile.in b/src/Makefile.in index 48b8b195fc..547b4d106a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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) diff --git a/src/acl.cc b/src/acl.cc index f5d7e624bb..1199cb6c66 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -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) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 820cc84408..d07cef361a 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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; diff --git a/src/cachemgr.cc b/src/cachemgr.cc index cfb0915ff1..5540227da5 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -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) diff --git a/src/client.cc b/src/client.cc index 4d34fb6194..fa2877eec5 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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 @@ -111,8 +111,8 @@ #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) diff --git a/src/client_side.cc b/src/client_side.cc index 370424754a..a32cbaf294 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 @@ -31,10 +31,10 @@ #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 diff --git a/src/comm.cc b/src/comm.cc index 0f6687bfe1..daaba8ec4f 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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; diff --git a/src/debug.cc b/src/debug.cc index 56a4aa2e73..7ad8a311f0 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -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); diff --git a/src/disk.cc b/src/disk.cc index b39537b1a9..c2b2659e8f 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -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; diff --git a/src/dns.cc b/src/dns.cc index 9ad470af16..645fe1aa4c 100644 --- a/src/dns.cc +++ b/src/dns.cc @@ -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; diff --git a/src/errorpage.cc b/src/errorpage.cc index 29d695f56f..3ed83194df 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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\

\n\ You may take a look at\n\

 %s
\n\ -or check with the cache administrator if you\n\ -believe this is incorrect.\n\ +or check with the\n\ +cache administrator\n\ +if you believe this is incorrect.\n\

\n\ %s\n\


\n\ @@ -320,6 +321,7 @@ Generated by %s/%s@%s\n\ url, redirect, redirect, + Config.adminEmail, Config.errHtmlText, appname, version_string, diff --git a/src/filemap.cc b/src/filemap.cc index 62d91fb816..96cd8e7c2e 100644 --- a/src/filemap.cc +++ b/src/filemap.cc @@ -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 @@ -123,8 +123,8 @@ #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; diff --git a/src/fqdncache.cc b/src/fqdncache.cc index bbced8dbfe..51fb128ab9 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -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; diff --git a/src/ftp.cc b/src/ftp.cc index b3839d6d9a..80e8978b62 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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) diff --git a/src/gopher.cc b/src/gopher.cc index 37916c0b1f..158f771133 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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"; diff --git a/src/http.cc b/src/http.cc index 6a5e29c391..20a22a1915 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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, diff --git a/src/icmp.cc b/src/icmp.cc index 83d6d94c05..e3d5a10be2 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -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; diff --git a/src/ident.cc b/src/ident.cc index 357430fa9d..ae71767a8f 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -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) diff --git a/src/ipcache.cc b/src/ipcache.cc index 6bc3bc0a3d..e7080f566f 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -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 diff --git a/src/main.cc b/src/main.cc index 52416a1123..f2b9c9a39e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 } diff --git a/src/neighbors.cc b/src/neighbors.cc index 99d2367552..912bd40295 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -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 @@ -105,9 +105,9 @@ #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; diff --git a/src/net_db.cc b/src/net_db.cc index f10ec4ca13..111e53828c 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,72 +1,202 @@ +#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 */ diff --git a/src/recv-announce.cc b/src/recv-announce.cc index ff78350a69..d00b6d54ab 100644 --- a/src/recv-announce.cc +++ b/src/recv-announce.cc @@ -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 @@ -117,7 +117,7 @@ #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 diff --git a/src/redirect.cc b/src/redirect.cc index 772afae69f..7be0585c69 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -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); diff --git a/src/squid.h b/src/squid.h index 27f3e720ba..b96cfe9827 100644 --- a/src/squid.h +++ b/src/squid.h @@ -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 * @@ -132,7 +132,7 @@ #include #endif -#if __STDC__ +#if __STDC__ #include #else #include @@ -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; diff --git a/src/ssl.cc b/src/ssl.cc index d2f060b8b2..2351d4fb58 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -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) diff --git a/src/stat.cc b/src/stat.cc index ae0fa65a36..c9ed0f0cde 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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); diff --git a/src/stmem.cc b/src/stmem.cc index db30c5c6ec..d04cd8f655 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -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); } diff --git a/src/store.cc b/src/store.cc index aed7a1063e..c1e943bdcc 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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,...) { diff --git a/src/tools.cc b/src/tools.cc index 7cf44c9081..d08f3e09fd 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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; diff --git a/src/tunnel.cc b/src/tunnel.cc index 1aeff8ebf6..cd92e41c90 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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) diff --git a/src/wais.cc b/src/wais.cc index 40f58bf3d8..260c005adb 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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)