X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jbsockets.c;h=b00d51447f43c51113931eb1008338aa00329f3b;hb=fc95f97a7020e56f373bf744715d73afe58b773a;hp=8d14cdf67f81aa55b140f7c44da74ce01d43a494;hpb=b484974d822139d2bc0dd344995e9f27ae3c1fe1;p=privoxy.git diff --git a/jbsockets.c b/jbsockets.c index 8d14cdf6..b00d5144 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.100 2011/04/27 18:11:05 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.103 2011/06/23 13:58:22 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -350,8 +350,17 @@ static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client /* Connection established, no need to try other addresses. */ break; } - log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", - csp->http->host_ip_addr_str, service, strerror(socket_error)); + if (rp->ai_next != NULL) + { + /* + * There's another address we can try, so log that this + * one didn't work out. If the last one fails, too, + * it will get logged outside the loop body so we don't + * have to mention it here. + */ + log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", + csp->http->host_ip_addr_str, service, strerror(socket_error)); + } } else { @@ -544,11 +553,6 @@ int write_socket(jb_socket fd, const char *buf, size_t len) return 0; } - if (len < 0) /* constant condition - size_t isn't ever negative */ - { - return 1; - } - log_error(LOG_LEVEL_WRITING, "to socket %d: %N", fd, len, buf); #if defined(_WIN32) @@ -768,9 +772,6 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) } hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; -#ifdef AI_ADDRCONFIG - hints.ai_flags |= AI_ADDRCONFIG; -#endif hints.ai_protocol = 0; /* Really any stream protocol or TCP only */ hints.ai_canonname = NULL; hints.ai_addr = NULL;