From: wessels <> Date: Mon, 14 Oct 1996 06:28:34 +0000 (+0000) Subject: Fix coredump for late (?) ICP replies by rearranging "Ignoring" checks X-Git-Tag: SQUID_3_0_PRE1~5664 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8de2f7ad1e4dd32824810fc8a466d39472cb0d0d;p=thirdparty%2Fsquid.git Fix coredump for late (?) ICP replies by rearranging "Ignoring" checks --- diff --git a/src/neighbors.cc b/src/neighbors.cc index 520314effa..4acf52f73a 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $Id: neighbors.cc,v 1.63 1996/10/09 22:49:38 wessels Exp $ + * $Id: neighbors.cc,v 1.64 1996/10/14 00:28:34 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -558,6 +558,15 @@ neighborsUdpAck(int fd, char *url, icp_common_t * header, struct sockaddr_in *fr debug(15, 1, "Ignoring ICP reply for missing mem_obj: %s\n", url); return; } + /* check if someone is already fetching it */ + if (BIT_TEST(entry->flag, ENTRY_DISPATCHED)) { + debug(15, 5, "neighborsUdpAck: '%s' already being fetched.\n", url); + return; + } + if (entry->ping_status != PING_WAITING) { + debug(15, 5, "neighborsUdpAck: '%s' unexpected ICP reply.\n", url); + return; + } if ((e = whichEdge(header, from))) { ntype = neighborType(e, entry->mem_obj->request); /* Neighbor is alive, reset the ack deficit */ @@ -576,15 +585,6 @@ neighborsUdpAck(int fd, char *url, icp_common_t * header, struct sockaddr_in *fr e->stats.rtt = (e->stats.rtt * (n - 1) + rtt) / n; e->icp_version = (int) header->version; } - /* check if someone is already fetching it */ - if (BIT_TEST(entry->flag, ENTRY_DISPATCHED)) { - debug(15, 5, "neighborsUdpAck: '%s' already being fetched.\n", url); - return; - } - if (entry->ping_status != PING_WAITING) { - debug(15, 5, "neighborsUdpAck: '%s' unexpected ICP reply.\n", url); - return; - } debug(15, 3, "neighborsUdpAck: %s for '%s' from %s \n", IcpOpcodeStr[header->opcode], url, e ? e->host : "source");