- James Housley made SFTP uploads use libssh2's non-blocking API (if available)

This commit is contained in:
Daniel Stenberg 2007-04-18 20:11:47 +00:00
parent 8e719e3ef5
commit 7a86740afd
3 changed files with 10 additions and 5 deletions

View File

@ -7,6 +7,8 @@
Changelog Changelog
Daniel S (18 April 2007) Daniel S (18 April 2007)
- James Housley made SFTP uploads use libssh2's non-blocking API
- Prevent the internal progress meter from updating more frequently than once - Prevent the internal progress meter from updating more frequently than once
per second. per second.

View File

@ -41,6 +41,6 @@ New curl mirrors:
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Song Ma, Dan Fandrich, Yang Tse, Jay Austin, Robert Iakobashvil Song Ma, Dan Fandrich, Yang Tse, Jay Austin, Robert Iakobashvil, James Housley
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -1018,17 +1018,20 @@ CURLcode Curl_sftp_done(struct connectdata *conn, CURLcode status,
ssize_t Curl_sftp_send(struct connectdata *conn, int sockindex, ssize_t Curl_sftp_send(struct connectdata *conn, int sockindex,
void *mem, size_t len) void *mem, size_t len)
{ {
ssize_t nwrite; ssize_t nwrite; /* libssh2_sftp_write() returns size_t !*/
/* libssh2_sftp_write() returns size_t !*/
#ifdef LIBSSH2SFTP_EAGAIN
/* we prefer the non-blocking API but that didn't exist previously */
nwrite = (ssize_t)
libssh2_sftp_writenb(conn->data->reqdata.proto.ssh->sftp_handle, mem, len);
#else
nwrite = (ssize_t) nwrite = (ssize_t)
libssh2_sftp_write(conn->data->reqdata.proto.ssh->sftp_handle, mem, len); libssh2_sftp_write(conn->data->reqdata.proto.ssh->sftp_handle, mem, len);
#endif
(void)sockindex; (void)sockindex;
return nwrite; return nwrite;
} }
/* The get_pathname() function is being borrowed from OpenSSH sftp.c /* The get_pathname() function is being borrowed from OpenSSH sftp.c
version 4.6p1. */ version 4.6p1. */
/* /*