]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
slightly more intelligent loop detector
authorwessels <>
Wed, 20 Jan 1999 02:23:27 +0000 (02:23 +0000)
committerwessels <>
Wed, 20 Jan 1999 02:23:27 +0000 (02:23 +0000)
src/forward.cc

index e910131cc13892082f4a4745a8047bbc4095436a..858b979bb8df76ce9df4cd4fa27d4fbac98ca954 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.51 1999/01/19 18:11:16 wessels Exp $
+ * $Id: forward.cc,v 1.52 1999/01/19 19:23:27 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -147,11 +147,12 @@ static void
 fwdConnectDone(int server_fd, int status, void *data)
 {
     FwdState *fwdState = data;
+    static FwdState *current = NULL;
     FwdServer *fs = fwdState->servers;
     ErrorState *err;
     request_t *request = fwdState->request;
-    static int loop_detect = 0;
-    assert(loop_detect++ == 0);
+    assert(current != fwdState);
+    current = fwdState;
     assert(fwdState->server_fd == server_fd);
     if (status == COMM_ERR_DNS) {
        fwdState->flags.dont_retry = 1;
@@ -184,7 +185,7 @@ fwdConnectDone(int server_fd, int status, void *data)
        fd_table[server_fd].uses++;
        fwdDispatch(fwdState);
     }
-    loop_detect--;
+    current = NULL;
 }
 
 static void