From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 15 Feb 2010 15:14:10 +0000 (+0000)
Subject: Also use the no-such-domain template if resolving addresses with getaddrinfo() fails.
X-Git-Tag: v_3_0_16~16
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/developer-manual/static/@default-cgi@show-status?a=commitdiff_plain;h=84dc24f176e7b7bab9ec5eb93f5520bf9c63d044;p=privoxy.git

Also use the no-such-domain template if resolving addresses with getaddrinfo() fails.

Reported by 'zebul666' in #2950483.
---

diff --git a/jbsockets.c b/jbsockets.c
index 5de9a54b..f5642730 100644
--- a/jbsockets.c
+++ b/jbsockets.c
@@ -1,4 +1,4 @@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.70 2009/12/15 17:51:14 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.71 2009/12/16 08:35:47 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@ -176,6 +176,8 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp)
    {
       log_error(LOG_LEVEL_INFO,
          "Can not resolve %s: %s", host, gai_strerror(retval));
+      /* XXX: Should find a better way to propagate this error. */
+      errno = EINVAL;
       csp->http->host_ip_addr_str = strdup("unknown");
       return(JB_INVALID_SOCKET);
    }