aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-04-18 20:11:47 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-04-18 20:11:47 +0000
commit7a86740afdc0ce97c3138d086e0ab5c0fad6c7f6 (patch)
tree060fb41967c617c421c424f0a7c753a7f312c4bc
parent8e719e3ef5ad90b7f8ad9c82a853df1afb23afd7 (diff)
- James Housley made SFTP uploads use libssh2's non-blocking API (if available)
-rw-r--r--CHANGES2
-rw-r--r--RELEASE-NOTES2
-rw-r--r--lib/ssh.c11
3 files changed, 10 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 8b1c024c3..94726ebcf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,8 @@
Changelog
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
per second.
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index c70daa222..5dee28b67 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -41,6 +41,6 @@ New curl mirrors:
This release would not have looked like this without help, code, reports and
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)
diff --git a/lib/ssh.c b/lib/ssh.c
index 1f8518aa8..a816c66c1 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1018,17 +1018,20 @@ CURLcode Curl_sftp_done(struct connectdata *conn, CURLcode status,
ssize_t Curl_sftp_send(struct connectdata *conn, int sockindex,
void *mem, size_t len)
{
- ssize_t nwrite;
-
- /* libssh2_sftp_write() returns size_t !*/
+ ssize_t nwrite; /* 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)
libssh2_sftp_write(conn->data->reqdata.proto.ssh->sftp_handle, mem, len);
+#endif
(void)sockindex;
return nwrite;
}
-
/* The get_pathname() function is being borrowed from OpenSSH sftp.c
version 4.6p1. */
/*