-const char gateway_rcs[] = "$Id: gateway.c,v 1.84 2012/02/29 19:35:11 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.86 2012/03/09 17:55:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
return FALSE;
}
- if (( (NULL != connection->gateway_host)
+ if (( (NULL != connection->gateway_host)
&& (NULL != fwd->gateway_host)
&& strcmpic(connection->gateway_host, fwd->gateway_host))
&& (connection->gateway_host != fwd->gateway_host))
return FALSE;
}
- if (( (NULL != connection->forward_host)
+ if (( (NULL != connection->forward_host)
&& (NULL != fwd->forward_host)
&& strcmpic(connection->forward_host, fwd->forward_host))
&& (connection->forward_host != fwd->forward_host))
strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos);
client_pos += (hostlen & 0xffu);
cbuf[client_pos++] = (char)((target_port >> 8) & 0xff);
- cbuf[client_pos++] = (char)((target_port ) & 0xff);
+ cbuf[client_pos++] = (char)((target_port ) & 0xff);
if (write_socket(sfd, cbuf, client_pos))
{
assert(errstr != NULL);
csp->error_message = strdup(errstr);
- if (server_size == -1)
- {
- /*
- * We didn't read() anything from the server at all.
- * Don't try to log a negative number of characters
- * which could trigger an assert().
- */
- server_size = 0;
- }
- log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s: %N", errstr, server_size, sbuf);
+ log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s", errstr);
close_socket(sfd);
errno = EINVAL;