Index: ChangeLog =================================================================== RCS file: /surf1/CVS/squid/ChangeLog,v retrieving revision 1.221.2.16 retrieving revision 1.221.2.18 diff -w -u -r1.221.2.16 -r1.221.2.18 --- ChangeLog 1997/03/31 03:27:32 1.221.2.16 +++ ChangeLog 1997/04/04 21:43:38 1.221.2.18 @@ -1,3 +1,17 @@ + - Require 0 <= multicast ttl <= 128. + - Changed 'unsigned int inaddr_none' to 'struct in_addr no_addr'. + - Added debug_trap() if unlocking a StoreEntry which still + has registered clients. + - Added missing storeUnregister() calls. + - Fixed storeClientListAdd() bug of adding same FD twice. + - Fixed reconfigure/SIGHUP to wait 'shutdown_lifetime' seconds + after receiving signal (Ron Gomes). + - Added missing commSetSelect() in icpDetectClientClose() + (Mark Treacy). + - Fixed multicast group member counting bug with fake + StoreEntry's. + - Only enable ICP_FLAG_SRC_RTT if the peer is ICP_VERSION_2. + Changes to squid-1.1.9 (March 30, 1997): - Fixed aclIpNetworkCompare for USE_SPLAY_TREE; was applying Index: src/Makefile.in =================================================================== RCS file: /surf1/CVS/squid/src/Makefile.in,v retrieving revision 1.65.2.3 retrieving revision 1.65.2.4 diff -w -u -r1.65.2.3 -r1.65.2.4 --- Makefile.in 1997/03/27 22:19:12 1.65.2.3 +++ Makefile.in 1997/04/04 16:11:43 1.65.2.4 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.65.2.3 1997/03/27 22:19:12 wessels Exp $ +# $Id: Makefile.in,v 1.65.2.4 1997/04/04 16:11:43 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -264,7 +264,7 @@ fi clean: - -rm -rf *.o *pure_* core $(PROGS) $(UTILS) $(CGIPROGS) + -rm -rf *.o *pure_* core $(PROGS) $(UTILS) $(CGIPROGS) $(SUID_UTILS) realclean: clean -rm -f Makefile squid.conf squid.conf.pre Index: src/acl.c =================================================================== RCS file: /surf1/CVS/squid/src/acl.c,v retrieving revision 1.85.2.7 retrieving revision 1.85.2.8 diff -w -u -r1.85.2.7 -r1.85.2.8 --- acl.c 1997/03/26 07:29:32 1.85.2.7 +++ acl.c 1997/04/04 15:42:58 1.85.2.8 @@ -1,5 +1,5 @@ /* - * $Id: acl.c,v 1.85.2.7 1997/03/26 07:29:32 wessels Exp $ + * $Id: acl.c,v 1.85.2.8 1997/04/04 15:42:58 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -242,7 +242,7 @@ switch (sscanf(asc, "%d.%d.%d.%d", &a1, &a2, &a3, &a4)) { case 4: /* a dotted quad */ - if ((a = (u_num32) inet_addr(asc)) != inaddr_none || + if ((a = (u_num32) inet_addr(asc)) != no_addr.s_addr || !strcmp(asc, "255.255.255.255")) { addr->s_addr = a; /* inet_addr() outputs in network byte order */ Index: src/cache_cf.c =================================================================== RCS file: /surf1/CVS/squid/src/cache_cf.c,v retrieving revision 1.174.2.11 retrieving revision 1.174.2.13 diff -w -u -r1.174.2.11 -r1.174.2.13 --- cache_cf.c 1997/03/28 20:28:11 1.174.2.11 +++ cache_cf.c 1997/04/04 15:42:59 1.174.2.13 @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.c,v 1.174.2.11 1997/03/28 20:28:11 wessels Exp $ + * $Id: cache_cf.c,v 1.174.2.13 1997/04/04 15:42:59 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -187,9 +187,9 @@ #define DefaultTcpRcvBufsz 0 /* use system default */ #define DefaultUdpMaxHitObjsz SQUID_UDP_SO_SNDBUF /* from configure */ #define DefaultTcpIncomingAddr INADDR_ANY -#define DefaultTcpOutgoingAddr inaddr_none +#define DefaultTcpOutgoingAddr no_addr.s_addr #define DefaultUdpIncomingAddr INADDR_ANY -#define DefaultUdpOutgoingAddr inaddr_none +#define DefaultUdpOutgoingAddr no_addr.s_addr #define DefaultClientNetmask 0xFFFFFFFFul #define DefaultPassProxy NULL #define DefaultSslProxy NULL @@ -508,6 +508,10 @@ weight = atoi(token + 7); } else if (!strncasecmp(token, "ttl=", 4)) { mcast_ttl = atoi(token + 4); + if (mcast_ttl < 0) + mcast_ttl = 0; + if (mcast_ttl > 128) + mcast_ttl = 128; } else if (!strncasecmp(token, "default", 7)) { options |= NEIGHBOR_DEFAULT_PARENT; } else if (!strncasecmp(token, "round-robin", 11)) { @@ -804,7 +808,7 @@ token = strtok(NULL, w_space); if (token == NULL) self_destruct(); - if (inet_addr(token) != inaddr_none) + if (inet_addr(token) != no_addr.s_addr) (*addr).s_addr = inet_addr(token); else if ((hp = gethostbyname(token))) /* dont use ipcache */ *addr = inaddrFromHostent(hp); @@ -959,7 +963,7 @@ token = strtok(NULL, w_space); if (token == NULL) self_destruct(); - if (inet_addr(token) != inaddr_none) + if (inet_addr(token) != no_addr.s_addr) Config.vizHack.addr.s_addr = inet_addr(token); else if ((hp = gethostbyname(token))) /* dont use ipcache */ Config.vizHack.addr = inaddrFromHostent(hp); Index: src/cachemgr.c =================================================================== RCS file: /surf1/CVS/squid/src/cachemgr.c,v retrieving revision 1.53.2.1 retrieving revision 1.53.2.3 diff -w -u -r1.53.2.1 -r1.53.2.3 --- cachemgr.c 1997/03/26 07:29:35 1.53.2.1 +++ cachemgr.c 1997/04/04 21:46:54 1.53.2.3 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.53.2.1 1997/03/26 07:29:35 wessels Exp $ + * $Id: cachemgr.c,v 1.53.2.3 1997/04/04 21:46:54 wessels Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -298,7 +298,7 @@ static const char *const w_space = " \t\n\r"; static const char *progname = NULL; static time_t now; -static unsigned int inaddr_none; +static struct in_addr no_addr; static char x2c _PARAMS((char *)); static int client_comm_connect _PARAMS((int sock, char *dest_host, u_short dest_port)); @@ -628,7 +628,7 @@ int single = TRUE; float f1; - inaddr_none = inet_addr("255.255.255.255"); + no_addr.s_addr = inet_addr("255.255.255.255"); now = time(NULL); if ((s = strrchr(argv[0], '/'))) progname = xstrdup(s + 1); @@ -994,7 +994,7 @@ { const struct hostent *hp; static struct sockaddr_in to_addr; - unsigned long haddr; + struct in_addr ip; /* Set up the destination socket address for message to send to. */ memset(&to_addr, '\0', sizeof(struct sockaddr_in)); @@ -1002,8 +1002,8 @@ if ((hp = gethostbyname(dest_host)) != NULL) xmemcpy(&to_addr.sin_addr, hp->h_addr, hp->h_length); - else if ((haddr = inet_addr(dest_host)) != inaddr_none) - xmemcpy(&to_addr.sin_addr, &haddr, sizeof(haddr)); + else if ((ip.s_addr = inet_addr(dest_host)) != no_addr.s_addr) + xmemcpy(&to_addr.sin_addr, &ip.s_addr, sizeof(ip.s_addr)); else return (-1); Index: src/comm.c =================================================================== RCS file: /surf1/CVS/squid/src/comm.c,v retrieving revision 1.138.2.8 retrieving revision 1.138.2.10 diff -w -u -r1.138.2.8 -r1.138.2.10 --- comm.c 1997/03/28 15:17:31 1.138.2.8 +++ comm.c 1997/04/04 16:12:20 1.138.2.10 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.138.2.8 1997/03/28 15:17:31 wessels Exp $ + * $Id: comm.c,v 1.138.2.10 1997/04/04 16:12:20 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -282,7 +282,7 @@ if (do_reuse) commSetReuseAddr(new_socket); } - if (addr.s_addr != inaddr_none) + if (addr.s_addr != no_addr.s_addr) if (commBind(new_socket, addr, port) != COMM_OK) return COMM_ERROR; conn->local_port = port; @@ -775,7 +775,11 @@ ftpServerClose(); dnsShutdownServers(); redirectShutdownServers(); - if (shutdown_pending > 0) + /* shutdown_pending will be set to + * +1 for SIGTERM + * -1 for SIGINT */ + /* reread_pending always == 1 when SIGHUP received */ + if (shutdown_pending > 0 || reread_pending > 0) setSocketShutdownLifetimes(Config.lifetimeShutdown); else setSocketShutdownLifetimes(0); @@ -959,7 +963,11 @@ ftpServerClose(); dnsShutdownServers(); redirectShutdownServers(); - if (shutdown_pending > 0) + /* shutdown_pending will be set to + * +1 for SIGTERM + * -1 for SIGINT */ + /* reread_pending always == 1 when SIGHUP received */ + if (shutdown_pending > 0 || reread_pending > 0) setSocketShutdownLifetimes(Config.lifetimeShutdown); else setSocketShutdownLifetimes(0); Index: src/dns.c =================================================================== RCS file: /surf1/CVS/squid/src/dns.c,v retrieving revision 1.30.2.1 retrieving revision 1.30.2.2 diff -w -u -r1.30.2.1 -r1.30.2.2 --- dns.c 1997/03/26 07:29:39 1.30.2.1 +++ dns.c 1997/04/04 15:49:11 1.30.2.2 @@ -1,5 +1,5 @@ /* - * $Id: dns.c,v 1.30.2.1 1997/03/26 07:29:39 wessels Exp $ + * $Id: dns.c,v 1.30.2.2 1997/04/04 15:49:11 wessels Exp $ * * DEBUG: section 34 Dnsserver interface * AUTHOR: Harvest Derived @@ -267,6 +267,7 @@ dns_child_table[k]->inpipe = dnssocket; dns_child_table[k]->outpipe = dnssocket; dns_child_table[k]->answer = squid_curtime; + dns_child_table[k]->dispatch_time = current_time; dns_child_table[k]->size = DNS_INBUF_SZ - 1; dns_child_table[k]->offset = 0; dns_child_table[k]->ip_inbuf = xcalloc(DNS_INBUF_SZ, 1); Index: src/dnsserver.c =================================================================== RCS file: /surf1/CVS/squid/src/dnsserver.c,v retrieving revision 1.32 retrieving revision 1.32.2.1 diff -w -u -r1.32 -r1.32.2.1 --- dnsserver.c 1997/02/06 18:02:10 1.32 +++ dnsserver.c 1997/04/04 15:43:02 1.32.2.1 @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.c,v 1.32 1997/02/06 18:02:10 wessels Exp $ + * $Id: dnsserver.c,v 1.32.2.1 1997/04/04 15:43:02 wessels Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -227,7 +227,7 @@ #endif /* _SQUID_NEXT_ */ static int do_debug = 0; -static unsigned int inaddr_none; +static struct in_addr no_addr; /* error messages from gethostbyname() */ static char * @@ -261,7 +261,7 @@ int i; int c; - inaddr_none = inet_addr("255.255.255.255"); + no_addr.s_addr = inet_addr("255.255.255.255"); #if HAVE_RES_INIT res_init(); @@ -301,7 +301,7 @@ for (;;) { int retry_count = 0; - int addrbuf; + struct in_addr ip; memset(request, '\0', 256); /* read from ipcache */ @@ -323,7 +323,7 @@ result = NULL; start = time(NULL); /* check if it's already an IP address in text form. */ - if (inet_addr(request) != inaddr_none) { + if (inet_addr(request) != no_addr.s_addr) { #if NO_REVERSE_LOOKUP printf("$name %s\n", request); printf("$h_name %s\n", request); @@ -335,9 +335,9 @@ fflush(stdout); continue; #endif - addrbuf = inet_addr(request); + ip.s_addr = inet_addr(request); for (;;) { - result = gethostbyaddr((char *) &addrbuf, 4, AF_INET); + result = gethostbyaddr((char *) &ip.s_addr, 4, AF_INET); if (result || h_errno != TRY_AGAIN) break; if (++retry_count == 2) Index: src/fqdncache.c =================================================================== RCS file: /surf1/CVS/squid/src/fqdncache.c,v retrieving revision 1.45.2.3 retrieving revision 1.45.2.4 diff -w -u -r1.45.2.3 -r1.45.2.4 --- fqdncache.c 1997/03/28 23:25:39 1.45.2.3 +++ fqdncache.c 1997/04/04 15:43:03 1.45.2.4 @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.c,v 1.45.2.3 1997/03/28 23:25:39 wessels Exp $ + * $Id: fqdncache.c,v 1.45.2.4 1997/04/04 15:43:03 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -739,7 +739,7 @@ char *name = inet_ntoa(addr); fqdncache_entry *f = NULL; const struct hostent *hp = NULL; - unsigned int ip; + struct in_addr ip; static char *static_name = NULL; if (!name) @@ -761,13 +761,13 @@ } FqdncacheStats.misses++; /* check if it's already a FQDN address in text form. */ - if (inet_addr(name) == inaddr_none) { + if (inet_addr(name) == no_addr.s_addr) { return name; } if (flags & FQDN_BLOCKING_LOOKUP) { FqdncacheStats.ghba_calls++; - ip = inet_addr(name); - hp = gethostbyaddr((char *) &ip, 4, AF_INET); + ip.s_addr = inet_addr(name); + hp = gethostbyaddr((char *) &ip.s_addr, 4, AF_INET); if (hp && hp->h_name && (hp->h_name[0] != '\0') && fqdn_table) { if (f->status == FQDN_PENDING || f->status == FQDN_DISPATCHED) { xfree(static_name); Index: src/ftp.c =================================================================== RCS file: /surf1/CVS/squid/src/ftp.c,v retrieving revision 1.94.2.3 retrieving revision 1.94.2.4 diff -w -u -r1.94.2.3 -r1.94.2.4 --- ftp.c 1997/03/26 07:29:41 1.94.2.3 +++ ftp.c 1997/04/04 15:43:04 1.94.2.4 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.94.2.3 1997/03/26 07:29:41 wessels Exp $ + * $Id: ftp.c,v 1.94.2.4 1997/04/04 15:43:04 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -488,7 +488,7 @@ if (data->authenticated) { strcat(buf, "-a "); } - if (Config.Addrs.tcp_outgoing.s_addr != inaddr_none) { + if (Config.Addrs.tcp_outgoing.s_addr != no_addr.s_addr) { sprintf(tbuf, "-o %s ", inet_ntoa(Config.Addrs.tcp_outgoing)); strcat(buf, tbuf); } Index: src/ftpget.c =================================================================== RCS file: /surf1/CVS/squid/src/ftpget.c,v retrieving revision 1.81.2.8 retrieving revision 1.81.2.11 diff -w -u -r1.81.2.8 -r1.81.2.11 --- ftpget.c 1997/03/28 03:50:24 1.81.2.8 +++ ftpget.c 1997/04/04 21:46:56 1.81.2.11 @@ -1,5 +1,5 @@ /* - * $Id: ftpget.c,v 1.81.2.8 1997/03/28 03:50:24 wessels Exp $ + * $Id: ftpget.c,v 1.81.2.11 1997/04/04 21:46:56 wessels Exp $ * * DEBUG: section 38 FTP Retrieval * AUTHOR: Harvest Derived @@ -312,7 +312,7 @@ static int o_skip_whitespace = 0; /* skip whitespace in listings */ static struct timeval starttime; static struct timeval currenttime; -unsigned int inaddr_none; +static struct in_addr no_addr; char *rfc1738_escape _PARAMS((const char *)); void rfc1738_unescape _PARAMS((char *)); @@ -1192,7 +1192,7 @@ char *host = proxy_host ? proxy_host : r->host; debug(38, 3, "parse_request: looking up '%s'\n", host); r->host_addr.s_addr = inet_addr(host); /* try numeric */ - if (r->host_addr.s_addr != inaddr_none) + if (r->host_addr.s_addr != no_addr.s_addr) return PARSE_OK; hp = gethostbyname(host); if (hp == NULL) { @@ -2578,11 +2578,11 @@ u_short port = FTP_PORT; const char *debug_args = "ALL,1"; extern char *optarg; - unsigned long ip; + struct in_addr ip; const struct hostent *hp = NULL; int c; - inaddr_none = inet_addr("255.255.255.255"); + no_addr.s_addr = inet_addr("255.255.255.255"); fullprogname = xstrdup(argv[0]); if ((t = strrchr(argv[0], '/'))) { progname = xstrdup(t + 1); @@ -2620,7 +2620,7 @@ } } - strcpy(visible_hostname, getfullhostname()); + xstrncpy(visible_hostname, getfullhostname(), SMALLBUFSIZ); while ((c = getopt(argc, argv, "AC:D:G:H:P:RS:Wab:c:hl:n:o:p:r:s:t:vw:")) != -1) { switch (c) { @@ -2642,8 +2642,7 @@ proxy_host = xstrdup(optarg); break; case 'H': - strncpy(visible_hostname, optarg, BUFSIZ); - visible_hostname[BUFSIZ] = '\0'; + xstrncpy(visible_hostname, optarg, SMALLBUFSIZ); break; case 'P': port = atoi(optarg); @@ -2686,8 +2685,8 @@ o_neg_ttl = atoi(optarg); break; case 'o': - if ((ip = inet_addr(optarg)) != inaddr_none) - outgoingTcpAddr.s_addr = ip; + if ((ip.s_addr = inet_addr(optarg)) != no_addr.s_addr) + outgoingTcpAddr.s_addr = ip.s_addr; else if ((hp = gethostbyname(optarg)) != NULL) outgoingTcpAddr = *(struct in_addr *) (void *) (hp->h_addr_list[0]); else { Index: src/icp.c =================================================================== RCS file: /surf1/CVS/squid/src/icp.c,v retrieving revision 1.228.2.7 retrieving revision 1.228.2.9 diff -w -u -r1.228.2.7 -r1.228.2.9 --- icp.c 1997/03/28 17:18:32 1.228.2.7 +++ icp.c 1997/04/04 16:13:14 1.228.2.9 @@ -1,6 +1,6 @@ /* - * $Id: icp.c,v 1.228.2.7 1997/03/28 17:18:32 wessels Exp $ + * $Id: icp.c,v 1.228.2.9 1997/04/04 16:13:14 wessels Exp $ * * DEBUG: section 12 Client Handling * AUTHOR: Harvest Derived @@ -301,7 +301,10 @@ storeUnlockObject(icpState->entry); icpState->entry = NULL; } + /* old_entry might still be set if we didn't yet get the reply + * code in icpHandleIMSReply() */ if (icpState->old_entry) { + storeUnregister(icpState->old_entry, fd); storeUnlockObject(icpState->old_entry); icpState->old_entry = NULL; } @@ -695,6 +698,7 @@ icpState->request->protocol, size); /* Set up everything for the logging */ + storeUnregister(entry, fd); storeUnlockObject(entry); icpState->entry = NULL; icpState->size += size; @@ -1284,6 +1288,7 @@ break; case ICP_OP_INVALID: + case ICP_OP_ERR: break; default: @@ -1369,6 +1374,7 @@ case ICP_OP_DECHO: case ICP_OP_MISS: case ICP_OP_DENIED: + case ICP_OP_MISS_NOFETCH: if (neighbors_do_private_keys && header.reqnum == 0) { debug(12, 0, "icpHandleIcpV3: Neighbor %s returned reqnum = 0\n", inet_ntoa(from.sin_addr)); @@ -1491,7 +1497,7 @@ else if (icp_version == ICP_VERSION_3) icpHandleIcpV3(sock, from, buf, len); else - debug(12, 0, "Unused ICP version %d received from %s:%d\n", + debug(12, 0, "WARNING: Unused ICP version %d received from %s:%d\n", icp_version, inet_ntoa(from.sin_addr), ntohs(from.sin_port)); @@ -2002,6 +2008,7 @@ } else { debug(12, 5, "icpDetectClientClose: FD %d closed?\n", fd); comm_set_stall(fd, 10); /* check again in 10 seconds */ + commSetSelect(fd, COMM_SELECT_READ, icpDetectClientClose, icpState, 0); } } Index: src/ipcache.c =================================================================== RCS file: /surf1/CVS/squid/src/ipcache.c,v retrieving revision 1.106.2.8 retrieving revision 1.106.2.11 diff -w -u -r1.106.2.8 -r1.106.2.11 --- ipcache.c 1997/03/28 23:25:37 1.106.2.8 +++ ipcache.c 1997/04/04 21:27:09 1.106.2.11 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.c,v 1.106.2.8 1997/03/28 23:25:37 wessels Exp $ + * $Id: ipcache.c,v 1.106.2.11 1997/04/04 21:27:09 wessels Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -991,13 +991,13 @@ ipcache_addrs * ipcacheCheckNumeric(const char *name) { - unsigned int ip; + struct in_addr ip; /* check if it's already a IP address in text form. */ - if ((ip = inet_addr(name)) == inaddr_none) + if ((ip.s_addr = inet_addr(name)) == no_addr.s_addr) return NULL; static_addrs.count = 1; static_addrs.cur = 0; - static_addrs.in_addrs[0].s_addr = ip; + static_addrs.in_addrs[0].s_addr = ip.s_addr; return &static_addrs; } Index: src/main.c =================================================================== RCS file: /surf1/CVS/squid/src/main.c,v retrieving revision 1.135.2.6 retrieving revision 1.135.2.7 diff -w -u -r1.135.2.6 -r1.135.2.7 --- main.c 1997/03/28 23:25:36 1.135.2.6 +++ main.c 1997/04/04 15:43:09 1.135.2.7 @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.135.2.6 1997/03/28 23:25:36 wessels Exp $ + * $Id: main.c,v 1.135.2.7 1997/04/04 15:43:09 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -139,7 +139,6 @@ const char *const dash_str = "-"; const char *const null_string = ""; char ThisCache[SQUIDHOSTNAMELEN << 1]; -unsigned int inaddr_none; /* for error reporting from xmalloc and friends */ extern void (*failure_notify) _PARAMS((const char *)); @@ -378,7 +377,7 @@ debug(1, 1, "Accepting ICP connections on FD %d.\n", theInIcpConnection); - if ((addr = Config.Addrs.udp_outgoing).s_addr != inaddr_none) { + if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); theOutIcpConnection = comm_open(SOCK_DGRAM, 0, @@ -646,7 +645,6 @@ any_addr.s_addr = inet_addr("0.0.0.0"); memset(&no_addr, '\0', sizeof(struct in_addr)); no_addr.s_addr = inet_addr("255.255.255.255"); - inaddr_none = inet_addr("255.255.255.255"); #if HAVE_SRANDOM srandom(time(NULL)); Index: src/neighbors.c =================================================================== RCS file: /surf1/CVS/squid/src/neighbors.c,v retrieving revision 1.122.2.13 retrieving revision 1.122.2.14 diff -w -u -r1.122.2.13 -r1.122.2.14 --- neighbors.c 1997/03/29 18:28:04 1.122.2.13 +++ neighbors.c 1997/04/04 16:14:07 1.122.2.14 @@ -1,5 +1,5 @@ /* - * $Id: neighbors.c,v 1.122.2.13 1997/03/29 18:28:04 wessels Exp $ + * $Id: neighbors.c,v 1.122.2.14 1997/04/04 16:14:07 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -520,6 +520,7 @@ if (e->icp_version == ICP_VERSION_2) flags |= ICP_FLAG_HIT_OBJ; if (Config.Options.query_icmp) + if (e->icp_version == ICP_VERSION_2) flags |= ICP_FLAG_SRC_RTT; query = icpCreateMessage(ICP_OP_QUERY, flags, url, reqnum, 0); icpUdpSend(theOutIcpConnection, @@ -1129,11 +1130,9 @@ fatal_dump("peerCountMcastPeersStart: non-multicast peer"); p->mcast.count_event_pending = 0; sprintf(url, "http://%s/", inet_ntoa(p->in_addr.sin_addr)); - if ((fake = storeGet(url)) == NULL) { fake = storeCreateEntry(url, NULL, 0, 0, METHOD_GET); - fake->mem_obj->request = requestLink(urlParse(METHOD_GET, url)); - } mem = fake->mem_obj; + mem->request = requestLink(urlParse(METHOD_GET, url)); mem->e_pings_n_pings = 0; mem->e_pings_n_acks = 0; mem->start_ping = current_time; Index: src/net_db.c =================================================================== RCS file: /surf1/CVS/squid/src/net_db.c,v retrieving revision 1.31.2.15 retrieving revision 1.31.2.16 diff -w -u -r1.31.2.15 -r1.31.2.16 --- net_db.c 1997/03/29 06:51:42 1.31.2.15 +++ net_db.c 1997/04/04 15:43:10 1.31.2.16 @@ -1,6 +1,6 @@ /* - * $Id: net_db.c,v 1.31.2.15 1997/03/29 06:51:42 wessels Exp $ + * $Id: net_db.c,v 1.31.2.16 1997/04/04 15:43:10 wessels Exp $ * * DEBUG: section 37 Network Measurement Database * AUTHOR: Duane Wessels @@ -373,7 +373,7 @@ memset(&N, '\0', sizeof(netdbEntry)); if ((t = strtok(buf, w_space)) == NULL) continue; - if ((addr.s_addr = inet_addr(t)) == inaddr_none) + if ((addr.s_addr = inet_addr(t)) == no_addr.s_addr) continue; if ((t = strtok(NULL, w_space)) == NULL) continue; Index: src/proto.c =================================================================== RCS file: /surf1/CVS/squid/src/proto.c,v retrieving revision 1.96.2.3 retrieving revision 1.96.2.4 diff -w -u -r1.96.2.3 -r1.96.2.4 --- proto.c 1997/03/26 08:17:45 1.96.2.3 +++ proto.c 1997/04/04 15:43:11 1.96.2.4 @@ -1,6 +1,6 @@ /* - * $Id: proto.c,v 1.96.2.3 1997/03/26 08:17:45 wessels Exp $ + * $Id: proto.c,v 1.96.2.4 1997/04/04 15:43:11 wessels Exp $ * * DEBUG: section 17 Neighbor Selection * AUTHOR: Harvest Derived @@ -412,7 +412,7 @@ return 0; if (url) redirectUnregister(url, fd); - if (src_addr.s_addr != inaddr_none) + if (src_addr.s_addr != no_addr.s_addr) fqdncacheUnregister(src_addr, fd); if (host) ipcache_unregister(host, fd); @@ -636,7 +636,7 @@ } /* Check for dotted-quads */ if (Config.firewall_ip_list) { - if ((addr.s_addr = inet_addr(host)) != inaddr_none) { + if ((addr.s_addr = inet_addr(host)) != no_addr.s_addr) { if (ip_access_check(addr, Config.firewall_ip_list) == IP_DENY) return INSIDE_FIREWALL; } Index: src/squid.h =================================================================== RCS file: /surf1/CVS/squid/src/squid.h,v retrieving revision 1.95.2.13 retrieving revision 1.95.2.14 diff -w -u -r1.95.2.13 -r1.95.2.14 --- squid.h 1997/03/27 22:19:15 1.95.2.13 +++ squid.h 1997/04/04 15:43:12 1.95.2.14 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.95.2.13 1997/03/27 22:19:15 wessels Exp $ + * $Id: squid.h,v 1.95.2.14 1997/04/04 15:43:12 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -337,7 +337,6 @@ extern struct in_addr local_addr; /* main.c */ extern struct in_addr theOutICPAddr; /* main.c */ extern const char *const localhost; -extern unsigned int inaddr_none; extern struct in_addr no_addr; /* comm.c */ extern int opt_udp_hit_obj; /* main.c */ extern int opt_mem_pools; /* main.c */ Index: src/store.c =================================================================== RCS file: /surf1/CVS/squid/src/store.c,v retrieving revision 1.212.2.12 retrieving revision 1.212.2.13 diff -w -u -r1.212.2.12 -r1.212.2.13 --- store.c 1997/03/28 16:55:44 1.212.2.12 +++ store.c 1997/04/04 16:15:02 1.212.2.13 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.212.2.12 1997/03/28 16:55:44 wessels Exp $ + * $Id: store.c,v 1.212.2.13 1997/04/04 16:15:02 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -598,6 +598,8 @@ #endif e->store_status = STORE_ABORTED; } + if (storePendingNClients(e) > 0) + debug_trap("storeUnlockObject: unlocked entry with pending clients\n"); if (BIT_TEST(e->flag, RELEASE_REQUEST)) { storeRelease(e); } else if (BIT_TEST(e->flag, ABORT_MSG_PENDING)) { @@ -2192,6 +2194,8 @@ mem->clients[i].fd = -1; } for (i = 0; i < mem->nclients; i++) { + if (mem->clients[i].fd == fd) + return i; /* its already here */ if (mem->clients[i].fd == -1) break; } @@ -2807,7 +2811,7 @@ return 0; x = (double) (store_swap_high - store_swap_size) / (store_swap_high - store_swap_low); x = x < 0.0 ? 0.0 : x > 1.0 ? 1.0 : x; - z = pow(Config.referenceAge, x); + z = pow((double) Config.referenceAge, x); age = (time_t) (z * 60.0); if (age < 60) age = 60; Index: src/unlinkd.c =================================================================== RCS file: /surf1/CVS/squid/src/Attic/unlinkd.c,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -w -u -r1.1.2.8 -r1.1.2.9 --- unlinkd.c 1997/03/29 05:24:21 1.1.2.8 +++ unlinkd.c 1997/04/04 16:11:30 1.1.2.9 @@ -1,5 +1,5 @@ /* - * $Id: unlinkd.c,v 1.1.2.8 1997/03/29 05:24:21 wessels Exp $ + * $Id: unlinkd.c,v 1.1.2.9 1997/04/04 16:11:30 wessels Exp $ * * DEBUG: section 43 Unlink Daemon * AUTHOR: Duane Wessels @@ -124,8 +124,10 @@ { char *buf; int l; - if (unlinkd_fd < 0) + if (unlinkd_fd < 0) { + safeunlink(path, 0); return; + } l = strlen(path) + 1; buf = xcalloc(1, l + 1); strcpy(buf, path);