diff options
| author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-10 22:32:52 +0200 |
|---|---|---|
| committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-10 22:32:52 +0200 |
| commit | bae409071522ae65c02bc36fccb87ee2a7179edf (patch) | |
| tree | 0481d1b62e6281b8de5b15ea78dd76ce0a681c9b /libssh/client.c | |
| parent | 403ded1e978f716769ade6d099b2419e4fceaff7 (diff) | |
Backport of the proxycommand feature
Diffstat (limited to 'libssh/client.c')
| -rw-r--r-- | libssh/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |
