version 1.153, 2016/06/02 04:26:32 |
version 1.154, 2016/06/27 23:58:08 |
|
|
int |
int |
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
int ch, s, ret, socksv; |
int ch, s = -1, ret, socksv; |
char *host, *uport; |
char *host, *uport; |
struct addrinfo hints; |
struct addrinfo hints; |
struct servent *sv; |
struct servent *sv; |
|
|
struct tls *tls_ctx = NULL; |
struct tls *tls_ctx = NULL; |
|
|
ret = 1; |
ret = 1; |
s = 0; |
|
socksv = 5; |
socksv = 5; |
host = NULL; |
host = NULL; |
uport = NULL; |
uport = NULL; |
|
|
build_ports(uport); |
build_ports(uport); |
|
|
/* Cycle through portlist, connecting to each port. */ |
/* Cycle through portlist, connecting to each port. */ |
for (i = 0; portlist[i] != NULL; i++) { |
for (s = -1, i = 0; portlist[i] != NULL; i++) { |
if (s) |
if (s != -1) |
close(s); |
close(s); |
|
|
if (usetls) { |
if (usetls) { |
|
|
else |
else |
s = remote_connect(host, portlist[i], hints); |
s = remote_connect(host, portlist[i], hints); |
|
|
if (s < 0) |
if (s == -1) |
continue; |
continue; |
|
|
ret = 0; |
ret = 0; |
|
|
} |
} |
} |
} |
|
|
if (s) |
if (s != -1) |
close(s); |
close(s); |
|
|
tls_config_free(tls_cfg); |
tls_config_free(tls_cfg); |