From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 13 Jun 2010 12:29:05 +0000 (+0000)
Subject: In resolve_hostname_to_ip(), limit the scope of the variable 'dns_retries'.
X-Git-Tag: v_3_0_17~133
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/static/diff?a=commitdiff_plain;h=2b61b8bd45da2d4b50ada68b05463e786d1495fb;p=privoxy.git

In resolve_hostname_to_ip(), limit the scope of the variable 'dns_retries'.
---

diff --git a/jbsockets.c b/jbsockets.c
index 7144028f..7ede5961 100644
--- a/jbsockets.c
+++ b/jbsockets.c
@@ -1,4 +1,4 @@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.73 2010/04/23 11:53:48 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.74 2010/06/13 12:28:27 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@ -1103,7 +1103,6 @@ unsigned long resolve_hostname_to_ip(const char *host)
 {
    struct sockaddr_in inaddr;
    struct hostent *hostp;
-   unsigned int dns_retries = 0;
 #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) || defined(HAVE_GETHOSTBYNAME_R_3_ARGS)
    struct hostent result;
 #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS)
@@ -1123,6 +1122,7 @@ unsigned long resolve_hostname_to_ip(const char *host)
 
    if ((inaddr.sin_addr.s_addr = inet_addr(host)) == -1)
    {
+      unsigned int dns_retries = 0;
 #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS)
       while (gethostbyname_r(host, &result, hbuf,
                 HOSTENT_BUFFER_SIZE, &hostp, &thd_err)