Mercurial > dropbear
diff cli-main.c @ 1051:359fba4b1a49
merge tcp fastopen
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 28 Feb 2015 23:24:30 +0800 |
parents | 0da8ba489c23 |
children | 23103e1e9548 |
line wrap: on
line diff
--- a/cli-main.c Tue Feb 24 22:48:14 2015 +0800 +++ b/cli-main.c Sat Feb 28 23:24:30 2015 +0800 @@ -30,6 +30,7 @@ #include "session.h" #include "dbrandom.h" #include "crypto_desc.h" +#include "netio.h" static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN; static void cli_dropbear_log(int priority, const char* format, va_list param); @@ -46,7 +47,7 @@ #endif int sock_in, sock_out; - char* error = NULL; + struct dropbear_progress_connection *progress = NULL; _dropbear_exit = cli_dropbear_exit; _dropbear_log = cli_dropbear_log; @@ -72,15 +73,11 @@ } else #endif { - int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, &error); - sock_in = sock_out = sock; + progress = connect_remote(cli_opts.remotehost, cli_opts.remoteport, cli_connected, &ses); + sock_in = sock_out = -1; } - if (sock_in < 0) { - dropbear_exit("%s", error); - } - - cli_session(sock_in, sock_out); + cli_session(sock_in, sock_out, progress); /* not reached */ return -1;