Skip to content

Unable to stat file when uploading #17

@Taxxodium

Description

@Taxxodium

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);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions