- James Housley made SFTP uploads use libssh2's non-blocking API (if available)
This commit is contained in:
11
lib/ssh.c
11
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. */
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user