Use a more traditional for loop to iterate over the tests in execute_regression_tests()
[privoxy.git] / gateway.c
index 933be51..a8da953 100644 (file)
--- a/gateway.c
+++ b/gateway.c
@@ -1,4 +1,4 @@
-const char gateway_rcs[] = "$Id: gateway.c,v 1.69 2011/02/19 13:54:00 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.72 2011/03/27 14:00:36 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/gateway.c,v $
@@ -88,11 +88,12 @@ static jb_socket socks5_connect(const struct forward_spec *fwd,
                                 int target_port,
                                 struct client_state *csp);
 
-
-#define SOCKS4_REQUEST_GRANTED          90
-#define SOCKS4_REQUEST_REJECT           91
-#define SOCKS4_REQUEST_IDENT_FAILED     92
-#define SOCKS4_REQUEST_IDENT_CONFLICT   93
+enum {
+   SOCKS4_REQUEST_GRANTED        =  90,
+   SOCKS4_REQUEST_REJECT         =  91,
+   SOCKS4_REQUEST_IDENT_FAILED   =  92,
+   SOCKS4_REQUEST_IDENT_CONFLICT =  93
+};
 
 enum {
    SOCKS5_REQUEST_GRANTED             = 0,
@@ -808,12 +809,8 @@ static jb_socket socks4_connect(const struct forward_spec * fwd,
 
    if (sfd == JB_INVALID_SOCKET)
    {
-      /*
-       * XXX: connect_to should fill in the exact reason.
-       * Most likely resolving the IP of the forwarder failed.
-       */
-      errstr = "connect_to failed: see logfile for details";
-      err = 1;
+      /* The error an its reason have already been logged by connect_to()  */
+      return(JB_INVALID_SOCKET);
    }
    else if (!data_is_available(sfd, csp->config->socket_timeout))
    {
@@ -1102,7 +1099,7 @@ static jb_socket socks5_connect(const struct forward_spec *fwd,
    }
    else if (server_size > 20)
    {
-      /* This is somewhat unexpected but doesn't realy matter. */
+      /* This is somewhat unexpected but doesn't really matter. */
       log_error(LOG_LEVEL_CONNECT, "socks5_connect: read %d bytes "
          "from socks server. Would have accepted up to %d.",
          server_size, sizeof(sbuf));