connect: Do not fail if the connect is in progress.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit a48711ae7e)
This commit is contained in:
Andreas Schneider
2014-10-15 10:27:55 +02:00
parent 1c59844dfe
commit 32a3cfe661

View File

@@ -383,7 +383,7 @@ socket_t ssh_connect_host_nonblocking(ssh_session session, const char *host,
}
rc = connect(s, itr->ai_addr, itr->ai_addrlen);
if (rc == -1) {
if (rc == -1 && (errno != EINPROGRESS)) {
ssh_set_error(session, SSH_FATAL,
"Failed to connect: %s", strerror(errno));
ssh_connect_socket_close(s);