1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-06-05 01:42:10 +03:00

client: If we have a pre-connected FD, set state to SOCKET_CONNECTED

Otherwise applications providing their own fd end up tripping an
assertion, since the session is just in _CONNECTING.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Colin Walters 2013-11-06 12:45:45 -05:00 committed by Andreas Schneider
parent aa33d18930
commit a8dc67ded8

View File

@ -504,6 +504,7 @@ int ssh_connect(ssh_session session) {
session->socket_callbacks.exception=ssh_socket_exception_callback;
session->socket_callbacks.userdata=session;
if (session->opts.fd != SSH_INVALID_SOCKET) {
session->session_state=SSH_SESSION_STATE_SOCKET_CONNECTED;
ssh_socket_set_fd(session->socket, session->opts.fd);
ret=SSH_OK;
#ifndef _WIN32