-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 $
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,
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))
{
}
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));