client: Do not close the socket if it was set via options

Fixes #122

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2022-04-19 16:22:12 +02:00
committed by Jakub Jelen
parent 442599f0d1
commit 4b20d7ad18

View File

@@ -720,8 +720,11 @@ ssh_disconnect(ssh_session session)
} }
ssh_packet_send(session); ssh_packet_send(session);
/* Do not close the socket, if the fd was set via options. */
if (session->opts.fd == SSH_INVALID_SOCKET) {
ssh_socket_close(session->socket); ssh_socket_close(session->socket);
} }
}
error: error:
session->recv_seq = 0; session->recv_seq = 0;