From ab5b4c7cfe668ee4103de146c2a739532abfc416 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 2 Oct 2009 14:06:41 +0200 Subject: Get rid of the options structure. --- examples/connect_ssh.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'examples/connect_ssh.c') diff --git a/examples/connect_ssh.c b/examples/connect_ssh.c index cfc6bb1..90a2f34 100644 --- a/examples/connect_ssh.c +++ b/examples/connect_ssh.c @@ -23,24 +23,24 @@ clients must be made or how a client should react. ssh_session connect_ssh(const char *host, const char *user,int verbosity){ ssh_session session; - ssh_options options; int auth=0; - options=ssh_options_new(); + session=ssh_new(); + if (session == NULL) { + return NULL; + } + if(user != NULL){ - if (ssh_options_set_username(options,user) < 0) { - ssh_options_free(options); + if (ssh_options_set(session, SSH_OPTIONS_USER, user) < 0) { + ssh_disconnect(session); return NULL; } } - if (ssh_options_set_host(options,host) < 0) { - ssh_options_free(options); + if (ssh_options_set(session, SSH_OPTIONS_HOST, host) < 0) { return NULL; } - ssh_options_set_log_verbosity(options,verbosity); - session=ssh_new(); - ssh_set_options(session,options); + ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); if(ssh_connect(session)){ fprintf(stderr,"Connection failed : %s\n",ssh_get_error(session)); ssh_disconnect(session); -- cgit v1.2.3