From: Dan Fandrich Date: Thu, 6 Mar 2014 11:48:33 +0000 (+0100) Subject: ssh: Pass errors from libssh2_sftp_read up the stack X-Git-Tag: curl-7_36_0~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e84d0b41f623081689f6578d07c8fa0fdd8e1324;p=curl ssh: Pass errors from libssh2_sftp_read up the stack --- diff --git a/lib/ssh.c b/lib/ssh.c index 00479c87d..3e3190d74 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -3118,6 +3118,7 @@ static ssize_t sftp_send(struct connectdata *conn, int sockindex, /* * Return number of received (decrypted) bytes + * or <0 on error */ static ssize_t sftp_recv(struct connectdata *conn, int sockindex, char *mem, size_t len, CURLcode *err) @@ -3132,6 +3133,9 @@ static ssize_t sftp_recv(struct connectdata *conn, int sockindex, if(nread == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nread = -1; + + } else if(nread < 0) { + *err = libssh2_session_error_to_CURLE(nread); } return nread; }