Skip to content
Snippets Groups Projects
Commit 09377cc6 authored by deuce's avatar deuce
Browse files

If the file offered by the remote already exists, reject if it's the same

size and date.

Previously, it would always skip which could result in the uplink holding
the files indefiniately.
parent 4ccf246d
No related branches found
No related tags found
No related merge requests found
...@@ -406,9 +406,14 @@ function callout_want_callback(fobj, fsize, fdate, offset, bp) ...@@ -406,9 +406,14 @@ function callout_want_callback(fobj, fsize, fdate, offset, bp)
// Or process the old ones first. // Or process the old ones first.
if (this.received_files.indexOf(fobj.name) != -1) if (this.received_files.indexOf(fobj.name) != -1)
return this.file.REJECT; return this.file.REJECT;
// Skip existing files. // Reject or skip existing files.
if (file_exists(fobj.name)) if (file_exists(fobj.name)) {
// If the size and date are the same, reject it.
if (fsize == file_size(fobj.name) && fdate == file_date(fobj.name))
return this.file.REJECT;
// Otherwise, skip it.
return this.file.SKIP; return this.file.SKIP;
}
// Accept everything else // Accept everything else
return this.file.ACCEPT; return this.file.ACCEPT;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment