diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-02-06 15:41:19 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-02-06 15:41:19 +0000 |
commit | 028a9d67856ad36aeae3919791d15780dafb397f (patch) | |
tree | 41673bb169fdaca59a230947e340821baf01f434 | |
parent | d0aca8017f3afe7671e6621f02c0f8e99412cb53 (diff) |
read SFTP with the non-blocking API
-rw-r--r-- | lib/ssh.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -974,12 +974,18 @@ ssize_t Curl_sftp_recv(struct connectdata *conn, int sockindex, char *mem, size_t len) { ssize_t nread; + (void)sockindex; /* libssh2_sftp_read() returns size_t !*/ +#ifdef LIBSSH2SFTP_EAGAIN + /* we prefer the non-blocking API but that didn't exist previously */ + nread = (ssize_t) + libssh2_sftp_readnb(conn->data->reqdata.proto.ssh->sftp_handle, mem, len); +#else nread = (ssize_t) libssh2_sftp_read(conn->data->reqdata.proto.ssh->sftp_handle, mem, len); - (void)sockindex; +#endif return nread; } |