diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-12-15 22:52:30 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-12-16 09:49:17 +0100 |
commit | 1befebc950d7e4fb1ae6ae4e9b6b284ff4a04f89 (patch) | |
tree | c16049568a5fe02007cdeacbc8f00f6b9b45b7c6 /lib/ssh.c | |
parent | ae56df82c155c9e9b6404ab87e69edcb55bd5a17 (diff) | |
download | curl-1befebc950d7e4fb1ae6ae4e9b6b284ff4a04f89.tar.gz |
SFTP: work-around servers that return zero size on STAT
Bug: http://curl.haxx.se/mail/lib-2014-12/0103.html
Pathed-by: Marc Renault
Diffstat (limited to 'lib/ssh.c')
-rw-r--r-- | lib/ssh.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2107,10 +2107,14 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) if(rc == LIBSSH2_ERROR_EAGAIN) { break; } - else if(rc) { + else if(rc || + !(attrs.flags & LIBSSH2_SFTP_ATTR_SIZE) || + (attrs.filesize == 0)) { /* * libssh2_sftp_open() didn't return an error, so maybe the server * just doesn't support stat() + * OR the server doesn't return a file size with a stat() + * OR file size is 0 */ data->req.size = -1; data->req.maxdownload = -1; |