|
Lines 1203-1209
do_download(struct sftp_conn *conn, const char *remote_path,
Link Here
|
| 1203 |
struct sshbuf *msg; |
1203 |
struct sshbuf *msg; |
| 1204 |
u_char *handle; |
1204 |
u_char *handle; |
| 1205 |
int local_fd = -1, write_error; |
1205 |
int local_fd = -1, write_error; |
| 1206 |
int read_error, write_errno, reordered = 0, r; |
1206 |
int read_error, write_errno, lmodified = 0, reordered = 0, r; |
| 1207 |
u_int64_t offset = 0, size, highwater; |
1207 |
u_int64_t offset = 0, size, highwater; |
| 1208 |
u_int mode, id, buflen, num_req, max_req, status = SSH2_FX_OK; |
1208 |
u_int mode, id, buflen, num_req, max_req, status = SSH2_FX_OK; |
| 1209 |
off_t progress_counter; |
1209 |
off_t progress_counter; |
|
Lines 1373-1378
do_download(struct sftp_conn *conn, const char *remote_path,
Link Here
|
| 1373 |
if (len > req->len) |
1373 |
if (len > req->len) |
| 1374 |
fatal("Received more data than asked for " |
1374 |
fatal("Received more data than asked for " |
| 1375 |
"%zu > %zu", len, req->len); |
1375 |
"%zu > %zu", len, req->len); |
|
|
1376 |
lmodified = 1; |
| 1376 |
if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || |
1377 |
if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || |
| 1377 |
atomicio(vwrite, local_fd, data, len) != len) && |
1378 |
atomicio(vwrite, local_fd, data, len) != len) && |
| 1378 |
!write_error) { |
1379 |
!write_error) { |
|
Lines 1476-1482
do_download(struct sftp_conn *conn, const char *remote_path,
Link Here
|
| 1476 |
error("Can't set times on \"%s\": %s", |
1477 |
error("Can't set times on \"%s\": %s", |
| 1477 |
local_path, strerror(errno)); |
1478 |
local_path, strerror(errno)); |
| 1478 |
} |
1479 |
} |
| 1479 |
if (fsync_flag) { |
1480 |
if (resume_flag && !lmodified) |
|
|
1481 |
logit("File \"%s\" was not modified", local_path); |
| 1482 |
else if (fsync_flag) { |
| 1480 |
debug("syncing \"%s\"", local_path); |
1483 |
debug("syncing \"%s\"", local_path); |
| 1481 |
if (fsync(local_fd) == -1) |
1484 |
if (fsync(local_fd) == -1) |
| 1482 |
error("Couldn't sync file \"%s\": %s", |
1485 |
error("Couldn't sync file \"%s\": %s", |