]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We have duplicated peerRefreshDNS events from frequent reconfigures.
authorwessels <>
Wed, 2 Dec 1998 12:03:28 +0000 (12:03 +0000)
committerwessels <>
Wed, 2 Dec 1998 12:03:28 +0000 (12:03 +0000)
We fix it by checking for an existing peerRefreshDNS pending event
and not queueing another.

src/event.cc
src/neighbors.cc
src/protos.h

index a8c2899f077c000b57ce4e6aa1196cba39f168d1..d49a97b3727e635969140fd67e7f8e67511a088a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: event.cc,v 1.23 1998/10/21 06:54:21 wessels Exp $
+ * $Id: event.cc,v 1.24 1998/12/02 05:03:28 wessels Exp $
  *
  * DEBUG: section 41    Event Processing
  * AUTHOR: Henrik Nordstrom
@@ -186,3 +186,14 @@ eventFreeMemory(void)
     }
     tasks = NULL;
 }
+
+int
+eventFind(EVH * func, void *arg)
+{
+    struct ev_entry *event;
+    for (event = tasks; event != NULL; event = event->next) {
+       if (event->func == func && event->arg == arg)
+           return 1;
+    }
+    return 0;
+}
index 7c9ba8530c979b83f9730354c25f28a522e53956..32cc821b41e54e03642814b8b65d741dec985766 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.262 1998/11/23 23:25:06 wessels Exp $
+ * $Id: neighbors.cc,v 1.263 1998/12/02 05:03:30 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -942,6 +942,8 @@ static void
 peerRefreshDNS(void *data)
 {
     peer *p = NULL;
+    if (eventFind(peerRefreshDNS, NULL))
+       return;
     if (!data && 0 == stat5minClientRequests()) {
        /* no recent client traffic, wait a bit */
        eventAddIsh("peerRefreshDNS", peerRefreshDNS, NULL, 180.0, 1);
index a9a1c85a264588b238eb510d626d4c354394eb5a..dc70dc59585dbd6afc82649998acd1cfa983842d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.292 1998/11/25 09:00:24 wessels Exp $
+ * $Id: protos.h,v 1.293 1998/12/02 05:03:29 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -215,6 +215,7 @@ extern time_t eventNextTime(void);
 extern void eventDelete(EVH * func, void *arg);
 extern void eventInit(void);
 extern void eventFreeMemory(void);
+extern int eventFind(EVH *, void *);
 
 extern void fd_close(int fd);
 extern void fd_open(int fd, unsigned int type, const char *);