aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 646c9fc33..434b80d06 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1599,6 +1599,11 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
figure out a "real" bitmask */
sshc->orig_waitfor = data->req.keepon;
+ /* since we don't really wait for anything at this point, we want the
+ state machine to move on as soon as possible so we set a very short
+ timeout here */
+ Curl_expire(data, 1);
+
state(conn, SSH_STOP);
}
break;
@@ -2042,8 +2047,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
}
sshc->sftp_handle = NULL;
}
- Curl_safefree(sftp_scp->path);
- sftp_scp->path = NULL;
+ if(sftp_scp) {
+ Curl_safefree(sftp_scp->path);
+ sftp_scp->path = NULL;
+ }
DEBUGF(infof(data, "SFTP DONE done\n"));
#if 0 /* PREV */
@@ -2587,10 +2594,9 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
rc = libssh2_knownhost_readfile(ssh->kh,
data->set.str[STRING_SSH_KNOWNHOSTS],
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
- if(rc) {
+ if(rc < 0)
infof(data, "Failed to read known hosts from %s\n",
data->set.str[STRING_SSH_KNOWNHOSTS]);
- }
}
#endif /* HAVE_LIBSSH2_KNOWNHOST_API */
@@ -2748,8 +2754,10 @@ static CURLcode ssh_done(struct connectdata *conn, CURLcode status)
else
result = status;
- Curl_safefree(sftp_scp->path);
- sftp_scp->path = NULL;
+ if(sftp_scp) {
+ Curl_safefree(sftp_scp->path);
+ sftp_scp->path = NULL;
+ }
Curl_pgrsDone(conn);
conn->data->req.keepon = 0; /* clear all bits */