diff options
author | Matt Johnston <matt@ucc.asn.au> | 2008-09-15 12:51:50 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2008-09-15 12:51:50 +0000 |
commit | b619e88f5481649a480e133494caf27f8880437a (patch) | |
tree | d8410822e892282abc5cdcd804db031285fe613c /cli-main.c | |
parent | 460bf4382257a262fda862f66d6fe97c749f5bb7 (diff) |
- Split main socket var into ses.sock_in/ses.sock_out in preparation
for -J proxy_cmd option (and some prelim options for that)
--HG--
extra : convert_revision : 47cdea9a7d66c553c6f5eec43b899821939d4e4c
Diffstat (limited to 'cli-main.c')
-rw-r--r-- | cli-main.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -39,7 +39,7 @@ int cli_main(int argc, char ** argv) { int main(int argc, char ** argv) { #endif - int sock; + int sock_in, sock_out; char* error = NULL; char* hostandport; int len; @@ -58,10 +58,18 @@ int main(int argc, char ** argv) { dropbear_exit("signal() error"); } - sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, - 0, &error); +#ifdef CLI_ENABLE_PROXYCMD + if (cli_runopts.proxycmd) { - if (sock < 0) { + } else +#endif + { + int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, + 0, &error); + sock_in = sock_out = sock; + } + + if (sock_in < 0) { dropbear_exit("%s", error); } @@ -72,7 +80,7 @@ int main(int argc, char ** argv) { snprintf(hostandport, len, "%s:%s", cli_opts.remotehost, cli_opts.remoteport); - cli_session(sock, hostandport); + cli_session(sock_in, sock_out, hostandport); /* not reached */ return -1; |