No change in behavour, this just makes the logic slightly more
understandable. In theory it would also allow the logic to be adjusted for
allowing short reads which is not quite clear from MS-SMB2 if we should allow
it. The file could be truncated while we're reading it.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12033
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
off_t dst_off;
off_t to_copy;
off_t remaining;
+ off_t copied;
size_t next_io_size;
};
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
+ state->copied += nwritten;
state->remaining -= nwritten;
if (state->remaining == 0) {
tevent_req_done(req);
return status;
}
- *copied = state->to_copy;
+ *copied = state->copied;
DBG_DEBUG("copy chunk copied %lu\n", (unsigned long)*copied);
tevent_req_received(req);