diff options
author | Daniel Stenberg <daniel@haxx.se> | 2012-11-12 10:04:44 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2012-11-12 10:04:44 +0100 |
commit | 1c23d2b39290032f739b1b441aba8bf89a0b834f (patch) | |
tree | c7ec122234b4357aefce694b658e73d9e1e8e9ba | |
parent | 7ecd874bce535a9a79670d6a3670de2b4667a45a (diff) |
SCP/SFTP: improve error code used for send failures
Instead of relying on the generic CURLE error for SCP or SFTP send
failures, try passing back a more suitable error if possible.
-rw-r--r-- | lib/ssh.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2982,6 +2982,10 @@ static ssize_t scp_send(struct connectdata *conn, int sockindex, *err = CURLE_AGAIN; nwrite = 0; } + else if(nwrite < LIBSSH2_ERROR_NONE) { + *err = libssh2_session_error_to_CURLE(nwrite); + nwrite = -1; + } return nwrite; } @@ -3126,6 +3130,10 @@ static ssize_t sftp_send(struct connectdata *conn, int sockindex, *err = CURLE_AGAIN; nwrite = 0; } + else if(nwrite < LIBSSH2_ERROR_NONE) { + *err = libssh2_session_error_to_CURLE(nwrite); + nwrite = -1; + } return nwrite; } |