* main routine for receiver process. * * Receiver process runs on the same host as the generator process. */
| 630 | * |
| 631 | * Receiver process runs on the same host as the generator process. */ |
| 632 | int recv_files(int f_in, int f_out, char *local_name) |
| 633 | { |
| 634 | int fd1,fd2; |
| 635 | STRUCT_STAT st; |
| 636 | int iflags, xlen; |
| 637 | char *fname, fbuf[MAXPATHLEN]; |
| 638 | char xname[MAXPATHLEN]; |
| 639 | char *fnametmp, fnametmpbuf[MAXPATHLEN]; |
| 640 | char *fnamecmp, *partialptr; |
| 641 | char fnamecmpbuf[MAXPATHLEN]; |
| 642 | uchar fnamecmp_type; |
| 643 | struct file_struct *file; |
| 644 | int itemizing = am_server ? logfile_format_has_i : stdout_format_has_i; |
| 645 | enum logcode log_code = log_before_transfer ? FLOG : FINFO; |
| 646 | int max_phase = protocol_version >= 29 ? 2 : 1; |
| 647 | int dflt_perms = (ACCESSPERMS & ~orig_umask); |
| 648 | #ifdef SUPPORT_ACLS |
| 649 | const char *parent_dirname = ""; |
| 650 | #endif |
| 651 | int ndx, recv_ok, one_inplace; |
| 652 | |
| 653 | if (DEBUG_GTE(RECV, 1)) |
| 654 | rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->used); |
| 655 | |
| 656 | if (delay_updates) |
| 657 | delayed_bits = bitbag_create(cur_flist->used + 1); |
| 658 | |
| 659 | if (whole_file < 0) |
| 660 | whole_file = 0; |
| 661 | |
| 662 | progress_init(); |
| 663 | |
| 664 | while (1) { |
| 665 | const char *basedir = NULL; |
| 666 | |
| 667 | cleanup_disable(); |
| 668 | |
| 669 | /* This call also sets cur_flist. */ |
| 670 | ndx = read_ndx_and_attrs(f_in, f_out, &iflags, &fnamecmp_type, |
| 671 | xname, &xlen); |
| 672 | if (ndx == NDX_DONE) { |
| 673 | if (!am_server && cur_flist) { |
| 674 | set_current_file_index(NULL, 0); |
| 675 | if (INFO_GTE(PROGRESS, 2)) |
| 676 | end_progress(0); |
| 677 | } |
| 678 | if (inc_recurse && first_flist) { |
| 679 | if (read_batch) { |
| 680 | ndx = first_flist->used + first_flist->ndx_start; |
| 681 | gen_wants_ndx(ndx, first_flist->flist_num); |
| 682 | } |
| 683 | flist_free(first_flist); |
| 684 | if (first_flist) |
| 685 | continue; |
| 686 | } else if (read_batch && first_flist) { |
| 687 | ndx = first_flist->used; |
| 688 | gen_wants_ndx(ndx, first_flist->flist_num); |
| 689 | } |
no test coverage detected