-
Notifications
You must be signed in to change notification settings - Fork 35
Description
When you initiate an upload, the library will return an error about being unable to stat the file even though the file was uploaded successfully.
The part where this happens is in the file DLSFTPUploadRequest.m around line 275
I've tried fixing it but without any luck.
Here's the code I've been playing with:
// stat the remote file after uploading
LIBSSH2_SFTP_ATTRIBUTES attributes;
while ( ((result = libssh2_sftp_fstat(self.handle, &attributes)) == LIBSSH2SFTP_EAGAIN)
&& self.isCancelled == NO){
waitsocket(socketFD, session);
}
if ([self ready] == NO) {
[self.connection requestDidFail:self withError:self.error];
return; }
// result is always LIBSSH2_ERROR_SFTP_PROTOCOL
if (result == LIBSSH2_ERROR_SFTP_PROTOCOL) {
result = libssh2_sftp_last_error([self.connection sftp]);
// usually result at this point is LIBSSH2_FX_FAILURE
if (result != LIBSSH2_FX_OK) {
result = libssh2_sftp_stat([self.connection sftp], [self.remotePath UTF8String], NULL);
}
}