From bae409071522ae65c02bc36fccb87ee2a7179edf Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 10 May 2010 22:32:52 +0200 Subject: Backport of the proxycommand feature --- libssh/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libssh/client.c') diff --git a/libssh/client.c b/libssh/client.c index 43081726..56267784 100644 --- a/libssh/client.c +++ b/libssh/client.c @@ -497,13 +497,18 @@ int ssh_connect(ssh_session session) { leave_function(); return SSH_ERROR; } - if (session->fd == -1 && session->host == NULL) { + if (session->fd == -1 && session->host == NULL && + session->ProxyCommand == NULL) { ssh_set_error(session, SSH_FATAL, "Hostname required"); leave_function(); return SSH_ERROR; } if (session->fd != -1) { fd = session->fd; +#ifndef _WIN32 + } else if (session->ProxyCommand != NULL) { + fd=ssh_socket_connect_proxycommand(session, session->ProxyCommand); +#endif } else { fd = ssh_connect_host(session, session->host, session->bindaddr, session->port, session->timeout, session->timeout_usec); -- cgit