]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix coredump for late (?) ICP replies by rearranging "Ignoring" checks
authorwessels <>
Mon, 14 Oct 1996 06:28:34 +0000 (06:28 +0000)
committerwessels <>
Mon, 14 Oct 1996 06:28:34 +0000 (06:28 +0000)
src/neighbors.cc

index 520314effaae985864ae803c1e9573808b902d62..4acf52f73ae176f6f744662711f18a27d5988f0f 100644 (file)
@@ -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");