diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2018-05-15 14:43:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-18 14:16:12 (GMT) |
commit | d431136e029c652f5913bcebeaab3b9236b114c4 (patch) | |
tree | c0838b4432a3786a323c94a680bb16f644198311 /lib/ssh-libssh.c | |
parent | af9e654045f11028e50dac4781e297834129a749 (diff) | |
download | CMake-d431136e029c652f5913bcebeaab3b9236b114c4.zip CMake-d431136e029c652f5913bcebeaab3b9236b114c4.tar.gz CMake-d431136e029c652f5913bcebeaab3b9236b114c4.tar.bz2 |
curl 2018-05-15 (cb013830)
Code extracted from:
https://github.com/curl/curl.git
at commit cb013830383f1ccc9757aba36bc32df5ec281c02 (curl-7_60_0).
Diffstat (limited to 'lib/ssh-libssh.c')
-rw-r--r-- | lib/ssh-libssh.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c index 56775d7..34ef490 100644 --- a/lib/ssh-libssh.c +++ b/lib/ssh-libssh.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2017 Red Hat, Inc. + * Copyright (C) 2017 - 2018 Red Hat, Inc. * * Authors: Nikos Mavrogiannopoulos, Tomas Mraz, Stanislav Zidek, * Robert Kolcun, Andreas Schneider @@ -383,8 +383,10 @@ static int myssh_is_known(struct connectdata *conn) } /* we don't have anything equivalent to knownkey. Always NULL */ + Curl_set_in_callback(data, true); rc = func(data, NULL, &foundkey, /* from the remote host */ keymatch, data->set.ssh_keyfunc_userp); + Curl_set_in_callback(data, false); switch(rc) { case CURLKHSTAT_FINE_ADD_TO_FILE: @@ -1046,7 +1048,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) attrs = sftp_stat(sshc->sftp_session, protop->path); if(attrs != 0) { - data->info.filetime = (long)attrs->mtime; + data->info.filetime = attrs->mtime; sftp_attributes_free(attrs); } @@ -1128,8 +1130,10 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) if(data->state.resume_from > 0) { /* Let's read off the proper amount of bytes from the input. */ if(conn->seek_func) { + Curl_set_in_callback(data, true); seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, SEEK_SET); + Curl_set_in_callback(data, false); } if(seekerr != CURL_SEEKFUNC_OK) { @@ -2421,8 +2425,7 @@ static ssize_t sftp_recv(struct connectdata *conn, int sockindex, ssize_t nread; (void)sockindex; - if(len >= (size_t)1<<32) - len = (size_t)(1<<31)-1; + DEBUGASSERT(len < CURL_MAX_READ_SIZE); switch(conn->proto.sshc.sftp_recv_state) { case 0: |