mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
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.
This commit is contained in:
parent
7ecd874bce
commit
1c23d2b392
@ -2982,6 +2982,10 @@ static ssize_t scp_send(struct connectdata *conn, int sockindex,
|
|||||||
*err = CURLE_AGAIN;
|
*err = CURLE_AGAIN;
|
||||||
nwrite = 0;
|
nwrite = 0;
|
||||||
}
|
}
|
||||||
|
else if(nwrite < LIBSSH2_ERROR_NONE) {
|
||||||
|
*err = libssh2_session_error_to_CURLE(nwrite);
|
||||||
|
nwrite = -1;
|
||||||
|
}
|
||||||
|
|
||||||
return nwrite;
|
return nwrite;
|
||||||
}
|
}
|
||||||
@ -3126,6 +3130,10 @@ static ssize_t sftp_send(struct connectdata *conn, int sockindex,
|
|||||||
*err = CURLE_AGAIN;
|
*err = CURLE_AGAIN;
|
||||||
nwrite = 0;
|
nwrite = 0;
|
||||||
}
|
}
|
||||||
|
else if(nwrite < LIBSSH2_ERROR_NONE) {
|
||||||
|
*err = libssh2_session_error_to_CURLE(nwrite);
|
||||||
|
nwrite = -1;
|
||||||
|
}
|
||||||
|
|
||||||
return nwrite;
|
return nwrite;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user