From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 27 Mar 2011 14:08:35 +0000 (+0000)
Subject: If forwarded-connect-retries is set, only retry if the we are actually forwarding... 
X-Git-Tag: v_3_0_18~273
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/%22javascript:back()/@url@?a=commitdiff_plain;h=047dec4f6f36e9a03eb4f10f201c9424ef850620;p=privoxy.git

If forwarded-connect-retries is set, only retry if the we are actually forwarding the request.
---

diff --git a/jbsockets.c b/jbsockets.c
index efc344c7..d25ed88f 100644
--- a/jbsockets.c
+++ b/jbsockets.c
@@ -1,4 +1,4 @@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.96 2011/03/27 14:03:43 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.97 2011/03/27 14:04:10 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@ -157,7 +157,8 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp)
 #else
       fd = no_rfc2553_connect_to(host, portnum, csp);
 #endif
-      if ((fd != JB_INVALID_SOCKET) || (errno != EINVAL))
+      if ((fd != JB_INVALID_SOCKET) || (errno == EINVAL)
+         || ((csp->fwd->forward_host == NULL) && (csp->fwd->type == SOCKS_NONE)))
       {
          break;
       }