sftp_write: handle FXP_WRITE errors
When an sftp server returns an error back on write, make sure the function bails out and returns the proper error.
This commit is contained in:
parent
8c9571b7ba
commit
2e352d3085
@ -1677,10 +1677,11 @@ static ssize_t sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer,
|
|||||||
|
|
||||||
chunk = next;
|
chunk = next;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
/* TODO: handle errors here! */
|
/* the server returned an error for that written chunk, propagate
|
||||||
break;
|
this back to our parent function */
|
||||||
}
|
return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||||
|
"FXP write failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if there were acked data in a previous call that wasn't returned then,
|
/* if there were acked data in a previous call that wasn't returned then,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user