]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
A new fix for the bug when FwdState reference count goes to zero
authorwessels <>
Mon, 8 May 2006 23:37:34 +0000 (23:37 +0000)
committerwessels <>
Mon, 8 May 2006 23:37:34 +0000 (23:37 +0000)
during a re-forward attempt.

src/forward.cc

index 68c247b8145545ac00f72a696aa8030fe3c6a68d..b391598bad227f9a99ce019b352375f6a5bbc3f6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.140 2006/05/07 15:13:24 wessels Exp $
+ * $Id: forward.cc,v 1.141 2006/05/08 17:37:34 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -280,6 +280,14 @@ FwdState::complete()
 
         storeEntryReset(e);
 
+        /*
+         * Need to re-establish the self-reference here since we'll
+         * be trying to forward the request again.  Otherwise the
+         * ref count could go to zero before a connection is
+         * established.
+         */
+        self = this;   // refcounted
+
         startComplete(servers);
     } else {
         debug(17, 3) ("fwdComplete: not re-forwarding status %d\n",