[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reconnecting to a session
[Thread Prev] | [Thread Next]
- Subject: Reconnecting to a session
- From: William Strecker-Kellogg <willsk@xxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 21 Nov 2012 13:10:55 -0500
- To: libssh@xxxxxxxxxx
Hi, Is it possible to reconnect to a session after calling ssh_disconnect()? The docs lead me to think that it should be, but doing following (with appropriate error checking) doesn't work. s = ssh_new(); ssh_options_set(s, SSH_OPTIONS_HOST, host); ssh_options_set(s, SSH_OPTIONS_LOG_VERBOSITY, &ssh_verbosity); ssh_options_set(s, SSH_OPTIONS_SSH1, &off); ssh_options_set(s, SSH_OPTIONS_COMPRESSION, &on) ssh_connect(session); ssh_is_server_known(session); ssh_userauth_autopubkey(session, NULL); ssh_disconnect(session); puts(ssh_get_disconnect_message(s)); ssh_connect(session); ssh_is_server_known(session); ssh_userauth_autopubkey(session, NULL); ssh_disconnect(session); puts(ssh_get_disconnect_message(s)); The first connect goes fine (auth done while running agent), but then the following: from the first get_disconnect_message(): "Connection not closed yet" from the second ssh_is_server_known() (error checking code not shown): "ssh_is_host_known called without cryptographic context" And the next authentication gives: "Received SSH_MSG_DISCONNECT: 33554432:Protocol error: expected packet type 30, got 50" Putting a sleep of 1-sec between calls doesn't fix things either, nor does calling ssh_silent_disconnect() instead. There is probably something I am missing and would appreciate any help along these lines. I can provide the full code that reproduces this, but am not sure where the problem lies (I suspect it all stems from the "Connection not close yet"). Thanks, Will
Archive administrator: postmaster@lists.cynapses.org