version 1.163, 2022/05/13 06:31:50 |
version 1.164, 2022/05/15 23:47:21 |
|
|
/* Sanity check */ |
/* Sanity check */ |
if (TAILQ_FIRST(&requests) != NULL) |
if (TAILQ_FIRST(&requests) != NULL) |
fatal("Transfer complete, but requests still in queue"); |
fatal("Transfer complete, but requests still in queue"); |
/* Truncate at highest contiguous point to avoid holes on interrupt */ |
/* |
if (read_error || write_error || interrupted) { |
* Truncate at highest contiguous point to avoid holes on interrupt, |
|
* or unconditionally if writing in place. |
|
*/ |
|
if (inplace_flag || read_error || write_error || interrupted) { |
if (reordered && resume_flag) { |
if (reordered && resume_flag) { |
error("Unable to resume download of \"%s\": " |
error("Unable to resume download of \"%s\": " |
"server reordered requests", local_path); |
"server reordered requests", local_path); |
|
|
status = SSH2_FX_FAILURE; |
status = SSH2_FX_FAILURE; |
} |
} |
|
|
if ((resume || inplace_flag) && (status != SSH2_FX_OK || interrupted)) { |
if (inplace_flag || (resume && (status != SSH2_FX_OK || interrupted))) { |
debug("truncating at %llu", (unsigned long long)highwater); |
debug("truncating at %llu", (unsigned long long)highwater); |
attrib_clear(&t); |
attrib_clear(&t); |
t.flags = SSH2_FILEXFER_ATTR_SIZE; |
t.flags = SSH2_FILEXFER_ATTR_SIZE; |
t.size = highwater; |
t.size = highwater; |
do_fsetstat(conn, handle, handle_len, &a); |
do_fsetstat(conn, handle, handle_len, &t); |
} |
} |
|
|
if (close(local_fd) == -1) { |
if (close(local_fd) == -1) { |