|
|
@ -92,6 +92,9 @@ int verbose = 0; |
|
|
|
|
|
|
|
static int mode = TCP_ONLY; |
|
|
|
static int auth = 0; |
|
|
|
#ifdef HAVE_SETRLIMIT |
|
|
|
static int nofile = 0; |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef __MINGW32__ |
|
|
|
static int setnonblocking(int fd) |
|
|
@ -693,9 +696,9 @@ int main(int argc, char **argv) |
|
|
|
USE_TTY(); |
|
|
|
|
|
|
|
#ifdef ANDROID |
|
|
|
while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:uUvVA")) != -1) { |
|
|
|
while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:n:uUvVA")) != -1) { |
|
|
|
#else |
|
|
|
while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:uUvA")) != -1) { |
|
|
|
while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:n:uUvA")) != -1) { |
|
|
|
#endif |
|
|
|
switch (c) { |
|
|
|
case 's': |
|
|
@ -744,6 +747,9 @@ int main(int argc, char **argv) |
|
|
|
case 'a': |
|
|
|
user = optarg; |
|
|
|
break; |
|
|
|
case 'n': |
|
|
|
nofile = atoi(optarg); |
|
|
|
break; |
|
|
|
case 'v': |
|
|
|
verbose = 1; |
|
|
|
break; |
|
|
@ -797,6 +803,21 @@ int main(int argc, char **argv) |
|
|
|
if (auth == 0) { |
|
|
|
auth = conf->auth; |
|
|
|
} |
|
|
|
#ifdef HAVE_SETRLIMIT |
|
|
|
if (nofile == 0) { |
|
|
|
nofile = conf->nofile; |
|
|
|
} |
|
|
|
/* |
|
|
|
* no need to check the return value here since we will show |
|
|
|
* the user an error message if setrlimit(2) fails |
|
|
|
*/ |
|
|
|
if (nofile > 1024) { |
|
|
|
if (verbose) { |
|
|
|
LOGI("setting NOFILE to %d", nofile); |
|
|
|
} |
|
|
|
set_nofile(nofile); |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
if (remote_num == 0 || remote_port == NULL || tunnel_addr_str == NULL || |
|
|
|