]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Wed, 4 Oct 2000 07:12:48 +0000 (07:12 +0000)
committerwessels <>
Wed, 4 Oct 2000 07:12:48 +0000 (07:12 +0000)
 - It was wrong to set the dont_retry flag in fwdConnectDone when
   we can't look up the IP address of a neighbor cache.  Its likely
   that there is an option to connect directly to the origin server,
   so forward.c should keep trying, rather than giving up so quickly.
   Now we only set dont_retry if we fail to look up the origin server
   IP address.

src/forward.cc

index 5e11d4ef4a937030f18057177f2dee302aae99d6..0190efad045030f1befa37498baa58652e86b042 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.73 2000/05/12 00:29:07 wessels Exp $
+ * $Id: forward.cc,v 1.74 2000/10/04 01:12:48 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -167,7 +167,13 @@ fwdConnectDone(int server_fd, int status, void *data)
     current = fwdState;
     assert(fwdState->server_fd == server_fd);
     if (status == COMM_ERR_DNS) {
-       fwdState->flags.dont_retry = 1;
+       /*
+        * Only set the dont_retry flag if the DNS lookup fails on
+        * a direct connection.  If DNS lookup fails when trying
+        * a neighbor cache, we may want to retry another option.
+        */
+       if (NULL == fs->peer)
+           fwdState->flags.dont_retry = 1;
        debug(17, 4) ("fwdConnectDone: Unknown host: %s\n",
            request->host);
        err = errorCon(ERR_DNS_FAIL, HTTP_SERVICE_UNAVAILABLE);