]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed queue traversal. we only check the last queue entry because
authorwessels <>
Mon, 19 Apr 1999 13:16:29 +0000 (13:16 +0000)
committerwessels <>
Mon, 19 Apr 1999 13:16:29 +0000 (13:16 +0000)
n->prev was always NULL after removing it from the double linked list.

src/dns_internal.cc

index 9dff6a8b4d37e53e620e68950c8b292bd4c6d5f0..af0b81998b1eb599b3514e631b9c3efacbc17b28 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns_internal.cc,v 1.11 1999/04/19 07:06:14 wessels Exp $
+ * $Id: dns_internal.cc,v 1.12 1999/04/19 07:16:29 wessels Exp $
  *
  * DEBUG: section 78    DNS lookups; interacts with lib/rfc1035.c
  * AUTHOR: Duane Wessels
@@ -318,14 +318,16 @@ static void
 idnsCheckQueue(void *unused)
 {
     dlink_node *n;
+    dlink_node *p = NULL;
     idns_query *q;
     event_queued = 0;
-    for (n = lru_list.tail; n; n = n->prev) {
+    for (n = lru_list.tail; n; n = p) {
        q = n->data;
        if (tvSubDsec(q->sent_t, current_time) < 5.0)
            break;
        debug(78, 3) ("idnsCheckQueue: ID %#04x timeout\n",
            q->id);
+       p = n->prev;
        dlinkDelete(&q->lru, &lru_list);
        if (q->nsends < IDNS_MAX_TRIES) {
            idnsSendQuery(q);