- file upload handler: if client-reported offset is less than file size,

don't just print an error message;
    lseek() back to the offset point.
    Otherwise we can end up with duplication in the file.


svn path=/trunk/boinc/; revision=23041
This commit is contained in:
David Anderson 2011-02-15 23:43:56 +00:00
parent 5421335dbb
commit d4df1871d5
2 changed files with 9 additions and 0 deletions

View File

@ -789,3 +789,11 @@ David 15 Feb 2011
transitioner.cpp
sched_resend.cpp
David 15 Feb 2011
- file upload handler: if client-reported offset is less than file size,
don't just print an error message;
lseek() back to the offset point.
Otherwise we can end up with duplication in the file.
sched/
file_upload_handler.cpp

View File

@ -196,6 +196,7 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) {
);
}
if (sbuf.st_size > offset) {
lseek(fd, offset, SEEK_SET);
log_messages.printf(MSG_CRITICAL,
"file %s length on disk %d bytes; host upload starting at %.0f bytes.\n",
this_filename, (int)sbuf.st_size, offset