diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-04-18 20:11:47 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-04-18 20:11:47 +0000 |
commit | 7a86740afdc0ce97c3138d086e0ab5c0fad6c7f6 (patch) | |
tree | 060fb41967c617c421c424f0a7c753a7f312c4bc /lib | |
parent | 8e719e3ef5ad90b7f8ad9c82a853df1afb23afd7 (diff) |
- James Housley made SFTP uploads use libssh2's non-blocking API (if available)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssh.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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. */ /* |