Due to a shadowed variable, transfer failures were not reflected in the return
code to sftp_put_file. Instead of tracking the return code, use the 'err'
variable to decide which return code to use.
struct sftp_request *req;
uint64 offset;
RFile *file;
struct sftp_request *req;
uint64 offset;
RFile *file;
struct fxp_attrs attrs;
long permissions;
struct fxp_attrs attrs;
long permissions;
if (!ret) {
printf("read size of %s: %s\n", outfname, fxp_error());
if (!ret) {
printf("read size of %s: %s\n", outfname, fxp_error());
goto cleanup;
}
if (!(attrs.flags & SSH_FILEXFER_ATTR_SIZE)) {
printf("read size of %s: size was not given\n", outfname);
goto cleanup;
}
if (!(attrs.flags & SSH_FILEXFER_ATTR_SIZE)) {
printf("read size of %s: size was not given\n", outfname);
goto cleanup;
}
offset = attrs.size;
goto cleanup;
}
offset = attrs.size;
* FIXME: we can use FXP_FSTAT here to get the file size, and
* thus put up a progress bar.
*/
* FIXME: we can use FXP_FSTAT here to get the file size, and
* thus put up a progress bar.
*/
xfer = xfer_upload_init(fh, offset);
xfer = xfer_upload_init(fh, offset);
while ((!err && !eof) || !xfer_done(xfer)) {
char buffer[4096];
int len, ret;
while ((!err && !eof) || !xfer_done(xfer)) {
char buffer[4096];
int len, ret;
+ return (err == 0) ? 1 : 0;
}
/* ----------------------------------------------------------------------
}
/* ----------------------------------------------------------------------