- Made delete_files() call send_file_list() and delete_missing()
[rsync/rsync.git] / receiver.c
CommitLineData
e327acec 1/* -*- c-file-style: "linux" -*-
17fadf7d 2
e327acec 3 Copyright (C) 1996-2000 by Andrew Tridgell
2f03f956 4 Copyright (C) Paul Mackerras 1996
17fadf7d 5
2f03f956
AT
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
17fadf7d 10
2f03f956
AT
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
17fadf7d 15
2f03f956
AT
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include "rsync.h"
22
23extern int verbose;
92b9eb97 24extern int delete_after;
2f03f956
AT
25extern int csum_length;
26extern struct stats stats;
27extern int dry_run;
16cc9ca2
WD
28extern int read_batch;
29extern int batch_gen_fd;
2f03f956 30extern int am_server;
41cfde6b 31extern int protocol_version;
2f03f956 32extern int relative_paths;
566fce32 33extern int keep_dirlinks;
2f03f956 34extern int preserve_hard_links;
92b9eb97 35extern int preserve_perms;
2f03f956
AT
36extern int io_error;
37extern char *tmpdir;
a7260c40 38extern char *partial_dir;
ee297522 39extern char *basis_dir[];
c56595d7 40extern int basis_dir_cnt;
53dd3135 41extern int make_backups;
16417f8b 42extern int do_progress;
925c517f 43extern int cleanup_got_literal;
92b9eb97
WD
44extern int module_id;
45extern int ignore_errors;
46extern int orig_umask;
55e50d89 47extern int keep_partial;
ba582f75 48extern int checksum_seed;
a3221d2a 49extern int inplace;
48e1c8c6 50extern int delay_updates;
2f03f956 51
7842418b 52extern struct filter_list_struct server_filter_list;
5ebab6c1
WD
53
54
3ab56a20
WD
55/* This deletes any files on the receiving side that are not present on the
56 * sending side. This is used by --delete-before and --delete-after. */
6957ae33 57void delete_files(struct file_list *flist)
2f03f956 58{
2430e984 59 struct file_list *dir_list;
3ab56a20 60 char fbuf[MAXPATHLEN];
2430e984 61 char *argv[1];
3ab56a20 62 int j;
2f03f956 63
1e82e2ce 64 for (j = 0; j < flist->count; j++) {
71e27c46 65 if (!(flist->files[j]->flags & FLAG_DEL_START)
a5342644
WD
66 || !S_ISDIR(flist->files[j]->mode))
67 continue;
2f03f956 68
2430e984
WD
69 argv[0] = f_name_to(flist->files[j], fbuf);
70 dir_list = send_file_list(-1, 1, argv);
71
72 delete_missing(flist, dir_list, fbuf);
73
74 flist_free(dir_list);
2f03f956
AT
75 }
76}
77
78
52d3e106
S
79/*
80 * get_tmpname() - create a tmp filename for a given filename
81 *
82 * If a tmpdir is defined, use that as the directory to
83 * put it in. Otherwise, the tmp filename is in the same
84 * directory as the given name. Note that there may be no
85 * directory at all in the given name!
17fadf7d 86 *
52d3e106
S
87 * The tmp filename is basically the given filename with a
88 * dot prepended, and .XXXXXX appended (for mkstemp() to
89 * put its unique gunk in). Take care to not exceed
90 * either the MAXPATHLEN or NAME_MAX, esp. the last, as
91 * the basename basically becomes 8 chars longer. In that
92 * case, the original name is shortened sufficiently to
93 * make it all fit.
17fadf7d 94 *
52d3e106
S
95 * Of course, there's no real reason for the tmp name to
96 * look like the original, except to satisfy us humans.
97 * As long as it's unique, rsync will work.
98 */
99
2f03f956
AT
100static int get_tmpname(char *fnametmp, char *fname)
101{
102 char *f;
52d3e106
S
103 int length = 0;
104 int maxname;
2f03f956 105
2f03f956 106 if (tmpdir) {
a24639bb 107 /* Note: this can't overflow, so the return value is safe */
b7cee949 108 length = strlcpy(fnametmp, tmpdir, MAXPATHLEN - 2);
52d3e106
S
109 fnametmp[length++] = '/';
110 fnametmp[length] = '\0'; /* always NULL terminated */
0c2ef5f4 111 }
52d3e106 112
0c2ef5f4 113 if ((f = strrchr(fname, '/')) != NULL) {
52d3e106
S
114 ++f;
115 if (!tmpdir) {
116 length = f - fname;
0c2ef5f4 117 /* copy up to and including the slash */
52d3e106 118 strlcpy(fnametmp, fname, length + 1);
0c2ef5f4 119 }
446e239e 120 } else
52d3e106 121 f = fname;
52d3e106
S
122 fnametmp[length++] = '.';
123 fnametmp[length] = '\0'; /* always NULL terminated */
2f03f956 124
52d3e106 125 maxname = MIN(MAXPATHLEN - 7 - length, NAME_MAX - 8);
2f03f956 126
0c2ef5f4 127 if (maxname < 1) {
52d3e106
S
128 rprintf(FERROR, "temporary filename too long: %s\n", fname);
129 fnametmp[0] = '\0';
2f03f956
AT
130 return 0;
131 }
132
17fadf7d 133 strlcpy(fnametmp + length, f, maxname);
52d3e106 134 strcat(fnametmp + length, ".XXXXXX");
2f03f956
AT
135
136 return 1;
137}
138
139
7e5fa372
WD
140static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
141 char *fname, int fd, OFF_T total_size)
2f03f956 142{
7e5fa372
WD
143 static char file_sum1[MD4_SUM_LENGTH];
144 static char file_sum2[MD4_SUM_LENGTH];
145 struct map_struct *mapbuf;
fc0257c9 146 struct sum_struct sum;
6c495e0d 147 int32 len;
2f03f956 148 OFF_T offset = 0;
89e540e6 149 OFF_T offset2;
2f03f956 150 char *data;
6c495e0d 151 int32 i;
e1f67417 152 char *map = NULL;
17fadf7d 153
fc0257c9 154 read_sum_head(f_in, &sum);
17fadf7d 155
7e5fa372 156 if (fd_r >= 0 && size_r > 0) {
80264051
WD
157 int32 read_size = MAX(sum.blength * 2, 16*1024);
158 mapbuf = map_file(fd_r, size_r, read_size, sum.blength);
7e5fa372
WD
159 if (verbose > 2) {
160 rprintf(FINFO, "recv mapped %s of size %.0f\n",
ecc81fce 161 safe_fname(fname_r), (double)size_r);
7e5fa372
WD
162 }
163 } else
164 mapbuf = NULL;
165
ba582f75 166 sum_init(checksum_seed);
17fadf7d 167
3f55bd5d 168 while ((i = recv_token(f_in, &data)) != 0) {
16417f8b
WD
169 if (do_progress)
170 show_progress(offset, total_size);
2f03f956
AT
171
172 if (i > 0) {
2f03f956 173 if (verbose > 3) {
5f808dfb
AT
174 rprintf(FINFO,"data recv %d at %.0f\n",
175 i,(double)offset);
2f03f956
AT
176 }
177
178 stats.literal_data += i;
179 cleanup_got_literal = 1;
17fadf7d 180
6c495e0d 181 sum_update(data, i);
2f03f956 182
c52461f9
WD
183 if (fd != -1 && write_file(fd,data,i) != i)
184 goto report_write_error;
2f03f956
AT
185 offset += i;
186 continue;
17fadf7d 187 }
2f03f956
AT
188
189 i = -(i+1);
6c495e0d 190 offset2 = i * (OFF_T)sum.blength;
fc0257c9 191 len = sum.blength;
d2a918b4 192 if (i == (int)sum.count-1 && sum.remainder != 0)
fc0257c9 193 len = sum.remainder;
17fadf7d 194
2f03f956 195 stats.matched_data += len;
17fadf7d 196
6c495e0d
WD
197 if (verbose > 3) {
198 rprintf(FINFO,
199 "chunk[%d] of size %ld at %.0f offset=%.0f\n",
200 i, (long)len, (double)offset2, (double)offset);
201 }
17fadf7d 202
446e239e
WD
203 if (mapbuf) {
204 map = map_ptr(mapbuf,offset2,len);
17fadf7d 205
c55f7021 206 see_token(map, len);
6c495e0d 207 sum_update(map, len);
c55f7021 208 }
17fadf7d 209
fab65a5b 210 if (inplace) {
89e540e6 211 if (offset == offset2 && fd != -1) {
c52461f9
WD
212 if (flush_write_file(fd) < 0)
213 goto report_write_error;
89e540e6
WD
214 offset += len;
215 if (do_lseek(fd, len, SEEK_CUR) != offset) {
fab65a5b
WD
216 rsyserr(FERROR, errno,
217 "lseek failed on %s",
218 full_fname(fname));
219 exit_cleanup(RERR_FILEIO);
220 }
89e540e6 221 continue;
a3221d2a 222 }
2f03f956 223 }
c52461f9
WD
224 if (fd != -1 && write_file(fd, map, len) != (int)len)
225 goto report_write_error;
2f03f956
AT
226 offset += len;
227 }
228
85f14172
WD
229 if (flush_write_file(fd) < 0)
230 goto report_write_error;
76c21947 231
25ff0441 232#if HAVE_FTRUNCATE
fab65a5b 233 if (inplace && fd != -1)
a3221d2a
WD
234 ftruncate(fd, offset);
235#endif
236
16417f8b
WD
237 if (do_progress)
238 end_progress(total_size);
2f03f956
AT
239
240 if (fd != -1 && offset > 0 && sparse_end(fd) != 0) {
c52461f9 241 report_write_error:
d62bcc17
WD
242 rsyserr(FERROR, errno, "write failed on %s",
243 full_fname(fname));
65417579 244 exit_cleanup(RERR_FILEIO);
2f03f956
AT
245 }
246
247 sum_end(file_sum1);
248
7e5fa372
WD
249 if (mapbuf)
250 unmap_file(mapbuf);
251
bc63ae3f 252 read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
d2a918b4 253 if (verbose > 2)
bc63ae3f 254 rprintf(FINFO,"got file_sum\n");
d2a918b4 255 if (fd != -1 && memcmp(file_sum1, file_sum2, MD4_SUM_LENGTH) != 0)
bc63ae3f 256 return 0;
2f03f956
AT
257 return 1;
258}
259
260
8ed9d849
WD
261static void discard_receive_data(int f_in, OFF_T length)
262{
7e5fa372 263 receive_data(f_in, NULL, -1, 0, NULL, -1, length);
8ed9d849
WD
264}
265
266
b35d0d8e
MP
267/**
268 * main routine for receiver process.
269 *
270 * Receiver process runs on the same host as the generator process. */
41cfde6b
WD
271int recv_files(int f_in, struct file_list *flist, char *local_name,
272 int f_in_name)
17fadf7d 273{
16cc9ca2 274 int next_gen_i = -1;
2f03f956
AT
275 int fd1,fd2;
276 STRUCT_STAT st;
446e239e 277 char *fname, fbuf[MAXPATHLEN];
f62c17e3 278 char template[MAXPATHLEN];
2f03f956 279 char fnametmp[MAXPATHLEN];
a7260c40 280 char *fnamecmp, *partialptr;
375a4556 281 char fnamecmpbuf[MAXPATHLEN];
48e1c8c6 282 uchar *delayed_bits = NULL;
2f03f956 283 struct file_struct *file;
1b7c47cb 284 struct stats initial_stats;
4e834af1
WD
285 int save_make_backups = make_backups;
286 int i, recv_ok, phase = 0;
11a5a3c7 287
d2a918b4 288 if (verbose > 2)
2f03f956 289 rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
2f03f956 290
cb869c26 291 if (flist->hlink_pool) {
9935066b
S
292 pool_destroy(flist->hlink_pool);
293 flist->hlink_pool = NULL;
294 }
295
48e1c8c6
WD
296 if (delay_updates) {
297 int sz = (flist->count + 7) / 8;
dc3afaf6 298 if (!(delayed_bits = new_array(uchar, sz)))
48e1c8c6
WD
299 out_of_memory("recv_files");
300 memset(delayed_bits, 0, sz);
301 }
302
17fadf7d 303 while (1) {
2f03f956
AT
304 cleanup_disable();
305
306 i = read_int(f_in);
307 if (i == -1) {
16cc9ca2 308 if (read_batch) {
41cfde6b
WD
309 if (next_gen_i != flist->count) {
310 do {
311 if (f_in_name >= 0
312 && next_gen_i >= 0)
313 read_byte(f_in_name);
314 } while (read_int(batch_gen_fd) != -1);
315 }
16cc9ca2
WD
316 next_gen_i = -1;
317 }
318
4e834af1
WD
319 if (phase)
320 break;
5ebab6c1 321
4e834af1
WD
322 phase = 1;
323 csum_length = SUM_LENGTH;
324 if (verbose > 2)
325 rprintf(FINFO, "recv_files phase=%d\n", phase);
326 send_msg(MSG_DONE, "", 0);
aec6b9f8 327 if (keep_partial && !partial_dir)
4e834af1
WD
328 make_backups = 0; /* prevents double backup */
329 continue;
2f03f956
AT
330 }
331
332 if (i < 0 || i >= flist->count) {
17fadf7d 333 rprintf(FERROR,"Invalid file index %d in recv_files (count=%d)\n",
2f03f956 334 i, flist->count);
65417579 335 exit_cleanup(RERR_PROTOCOL);
2f03f956
AT
336 }
337
338 file = flist->files[i];
2f03f956 339
97feb557 340 stats.current_file_index = i;
2f03f956
AT
341 stats.num_transferred_files++;
342 stats.total_transferred_size += file->length;
925c517f 343 cleanup_got_literal = 0;
2f03f956
AT
344
345 if (local_name)
346 fname = local_name;
446e239e 347 else
3fef5364 348 fname = f_name_to(file, fbuf);
2f03f956
AT
349
350 if (dry_run) {
ecc81fce
WD
351 if (!am_server && verbose) /* log the transfer */
352 rprintf(FINFO, "%s\n", safe_fname(fname));
2f03f956
AT
353 continue;
354 }
355
1b7c47cb
AT
356 initial_stats = stats;
357
2f03f956 358 if (verbose > 2)
ecc81fce 359 rprintf(FINFO, "recv_files(%s)\n", safe_fname(fname));
2f03f956 360
16cc9ca2
WD
361 if (read_batch) {
362 while (i > next_gen_i) {
41cfde6b
WD
363 if (f_in_name >= 0 && next_gen_i >= 0)
364 read_byte(f_in_name);
16cc9ca2
WD
365 next_gen_i = read_int(batch_gen_fd);
366 if (next_gen_i == -1)
367 next_gen_i = flist->count;
368 }
369 if (i < next_gen_i) {
370 rprintf(FINFO, "skipping update for \"%s\"\n",
ecc81fce 371 safe_fname(fname));
16cc9ca2
WD
372 discard_receive_data(f_in, file->length);
373 continue;
374 }
41cfde6b 375 next_gen_i = -1;
16cc9ca2
WD
376 }
377
7842418b
WD
378 if (server_filter_list.head
379 && check_filter(&server_filter_list, fname,
5ebab6c1 380 S_ISDIR(file->mode)) < 0) {
33eff8bf
WD
381 rprintf(FERROR, "attempt to hack rsync failed.\n");
382 exit_cleanup(RERR_PROTOCOL);
5ebab6c1
WD
383 }
384
41cfde6b
WD
385 partialptr = partial_dir ? partial_dir_fname(fname) : fname;
386
387 if (f_in_name >= 0) {
ee297522
WD
388 uchar j;
389 switch (j = read_byte(f_in_name)) {
41cfde6b 390 case FNAMECMP_FNAME:
a7260c40 391 fnamecmp = fname;
41cfde6b
WD
392 break;
393 case FNAMECMP_PARTIAL_DIR:
394 fnamecmp = partialptr ? partialptr : fname;
395 break;
396 case FNAMECMP_BACKUP:
397 fnamecmp = get_backup_name(fname);
398 break;
41cfde6b 399 default:
c56595d7
WD
400 if (j >= basis_dir_cnt) {
401 rprintf(FERROR,
402 "invalid basis_dir index: %d.\n",
403 j);
404 exit_cleanup(RERR_PROTOCOL);
405 }
41cfde6b 406 pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
ee297522 407 basis_dir[j], fname);
41cfde6b
WD
408 fnamecmp = fnamecmpbuf;
409 break;
410 }
a7260c40 411 } else
41cfde6b 412 fnamecmp = fname;
dc55d7bd 413
17fadf7d 414 /* open the file */
8c9fd200 415 fd1 = do_open(fnamecmp, O_RDONLY, 0);
375a4556 416
2f03f956 417 if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
d62bcc17
WD
418 rsyserr(FERROR, errno, "fstat %s failed",
419 full_fname(fnamecmp));
8ed9d849 420 discard_receive_data(f_in, file->length);
2f03f956
AT
421 close(fd1);
422 continue;
423 }
424
350e4e4d
S
425 if (fd1 != -1 && S_ISDIR(st.st_mode) && fnamecmp == fname) {
426 /* this special handling for directories
427 * wouldn't be necessary if robust_rename()
428 * and the underlying robust_unlink could cope
429 * with directories
430 */
ea42541f
WD
431 rprintf(FERROR,"recv_files: %s is a directory\n",
432 full_fname(fnamecmp));
8ed9d849 433 discard_receive_data(f_in, file->length);
2f03f956
AT
434 close(fd1);
435 continue;
436 }
437
350e4e4d
S
438 if (fd1 != -1 && !S_ISREG(st.st_mode)) {
439 close(fd1);
440 fd1 = -1;
350e4e4d
S
441 }
442
4df9f368 443 if (fd1 != -1 && !preserve_perms) {
85ed0aa3 444 /* if the file exists already and we aren't preserving
17fadf7d
WD
445 * permissions then act as though the remote end sent
446 * us the file permissions we already have */
4df9f368
AT
447 file->mode = st.st_mode;
448 }
449
a3221d2a
WD
450 /* We now check to see if we are writing file "inplace" */
451 if (inplace) {
dc55d7bd 452 fd2 = do_open(fname, O_WRONLY|O_CREAT, 0);
a3221d2a
WD
453 if (fd2 == -1) {
454 rsyserr(FERROR, errno, "open %s failed",
dc55d7bd 455 full_fname(fname));
8ed9d849 456 discard_receive_data(f_in, file->length);
a3221d2a
WD
457 if (fd1 != -1)
458 close(fd1);
459 continue;
460 }
461 } else {
462 if (!get_tmpname(fnametmp,fname)) {
8ed9d849 463 discard_receive_data(f_in, file->length);
a3221d2a
WD
464 if (fd1 != -1)
465 close(fd1);
466 continue;
467 }
468
469 strlcpy(template, fnametmp, sizeof template);
2f03f956 470
a3221d2a
WD
471 /* we initially set the perms without the
472 * setuid/setgid bits to ensure that there is no race
473 * condition. They are then correctly updated after
474 * the lchown. Thanks to snabb@epipe.fi for pointing
475 * this out. We also set it initially without group
476 * access because of a similar race condition. */
f62c17e3 477 fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS);
17fadf7d 478
a3221d2a
WD
479 /* in most cases parent directories will already exist
480 * because their information should have been previously
481 * transferred, but that may not be the case with -R */
482 if (fd2 == -1 && relative_paths && errno == ENOENT
483 && create_directory_path(fnametmp, orig_umask) == 0) {
484 strlcpy(fnametmp, template, sizeof fnametmp);
485 fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS);
486 }
487 if (fd2 == -1) {
488 rsyserr(FERROR, errno, "mkstemp %s failed",
489 full_fname(fnametmp));
8ed9d849 490 discard_receive_data(f_in, file->length);
a3221d2a
WD
491 if (fd1 != -1)
492 close(fd1);
493 continue;
494 }
495
a7260c40
WD
496 if (partialptr)
497 cleanup_set(fnametmp, partialptr, file, fd1, fd2);
a3221d2a 498 }
2f03f956 499
ecc81fce
WD
500 if (!am_server && verbose) /* log the transfer */
501 rprintf(FINFO, "%s\n", safe_fname(fname));
11a5a3c7 502
2f03f956 503 /* recv file data */
7e5fa372
WD
504 recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
505 fname, fd2, file->length);
1b7c47cb
AT
506
507 log_recv(file, &initial_stats);
17fadf7d 508
d2a918b4 509 if (fd1 != -1)
2f03f956 510 close(fd1);
9f27cd8c 511 if (close(fd2) < 0) {
d62bcc17
WD
512 rsyserr(FERROR, errno, "close failed on %s",
513 full_fname(fnametmp));
9f27cd8c
WD
514 exit_cleanup(RERR_FILEIO);
515 }
17fadf7d 516
48e1c8c6 517 if ((recv_ok && !delay_updates) || inplace) {
aec6b9f8
WD
518 finish_transfer(fname, fnametmp, file, recv_ok, 1);
519 if (partialptr != fname && fnamecmp == partialptr) {
520 do_unlink(partialptr);
521 handle_partial_dir(partialptr, PDIR_DELETE);
522 }
523 } else if (keep_partial && partialptr
524 && handle_partial_dir(partialptr, PDIR_CREATE)) {
525 finish_transfer(partialptr, fnametmp, file, recv_ok,
526 !partial_dir);
48e1c8c6
WD
527 if (delay_updates && recv_ok)
528 delayed_bits[i/8] |= 1 << (i % 8);
aec6b9f8 529 } else {
a7260c40 530 partialptr = NULL;
55e50d89 531 do_unlink(fnametmp);
a7260c40
WD
532 }
533
2f03f956 534 cleanup_disable();
554e0a8d 535
2f03f956 536 if (!recv_ok) {
007e3c0e
WD
537 int msgtype = csum_length == SUM_LENGTH || read_batch ?
538 FERROR : FINFO;
539 if (msgtype == FERROR || verbose) {
a7260c40
WD
540 char *errstr, *redostr, *keptstr;
541 if (!(keep_partial && partialptr) && !inplace)
542 keptstr = "discarded";
543 else if (partial_dir)
544 keptstr = "put into partial-dir";
545 else
546 keptstr = "retained";
007e3c0e
WD
547 if (msgtype == FERROR) {
548 errstr = "ERROR";
549 redostr = "";
550 } else {
551 errstr = "WARNING";
552 redostr = " (will try again)";
553 }
554 rprintf(msgtype,
a7260c40 555 "%s: %s failed verification -- update %s%s.\n",
ecc81fce
WD
556 errstr, safe_fname(fname),
557 keptstr, redostr);
007e3c0e 558 }
e2bc4126 559 if (csum_length != SUM_LENGTH) {
0569a133 560 char buf[4];
0569a133
WD
561 SIVAL(buf, 0, i);
562 send_msg(MSG_REDO, buf, 4);
2f03f956
AT
563 }
564 }
565 }
4e834af1 566 make_backups = save_make_backups;
2f03f956 567
48e1c8c6
WD
568 if (delay_updates) {
569 for (i = 0; i < flist->count; i++) {
570 struct file_struct *file = flist->files[i];
571 if (!file->basename
572 || !(delayed_bits[i/8] & (1 << (i % 8))))
573 continue;
574 fname = local_name ? local_name : f_name(file);
575 partialptr = partial_dir_fname(fname);
576 if (partialptr) {
577 if (make_backups && !make_backup(fname))
578 continue;
579 if (verbose > 2) {
580 rprintf(FINFO, "renaming %s to %s\n",
581 partialptr, fname);
582 }
583 if (do_rename(partialptr, fname) < 0) {
584 rsyserr(FERROR, errno,
585 "rename failed for %s (from %s)",
586 fname, partialptr);
587 } else {
588 handle_partial_dir(partialptr,
589 PDIR_DELETE);
590 }
591 }
592 }
593 }
594
2430e984 595 if (delete_after && !local_name && flist->count > 0)
3f55bd5d 596 delete_files(flist);
57df171b 597
2f03f956
AT
598 if (verbose > 2)
599 rprintf(FINFO,"recv_files finished\n");
17fadf7d 600
2f03f956
AT
601 return 0;
602}