[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] 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.
---
 src/client.c | 1 +
 1 file changed, 1 insertion(+)


From 0ce6e4101d351922ce8a492ee56cf8089dc4542f Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@xxxxxxxxxx>
Date: Wed, 6 Nov 2013 12:45:45 -0500
Subject: [PATCH 1/3] 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.
---
 src/client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/client.c b/src/client.c
index 1fb963d..35c396a 100644
--- a/src/client.c
+++ b/src/client.c
@@ -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
-- 
1.8.3.1


Archive administrator: postmaster@lists.cynapses.org