+ if ((i = get_redo_num()) == -1) {
+ if (incremental)
+ break;
+ wait_for_receiver();
+ continue;
+ }
+
+ save_flist = cur_flist;
+ cur_flist = flist_for_ndx(i);
+ file = cur_flist->files[i];
+ if (local_name)
+ strlcpy(fbuf, local_name, sizeof fbuf);
+ else
+ f_name(file, fbuf);
+ recv_generator(fbuf, file, i, itemizing, code, f_out);
+ cur_flist->to_redo--;
+ cur_flist = save_flist;
+ }
+
+ csum_length = SHORT_SUM_LENGTH;
+ max_size = -max_size;
+ min_size = -min_size;
+ ignore_existing = -ignore_existing;
+ ignore_non_existing = -ignore_non_existing;
+ update_only = -update_only;
+ always_checksum = -always_checksum;
+ size_only = -size_only;
+ append_mode = -append_mode;
+ make_backups = -make_backups;
+ ignore_times--;
+
+ if (!incremental)
+ break;
+
+ while (!cur_flist->next && !flist_eof)
+ wait_for_receiver();
+ next_flist = cur_flist->next;
+ while (first_flist != next_flist) {
+ struct file_struct *fp;
+ if (first_flist->in_progress || first_flist->to_redo) {
+ if (next_flist)
+ break;
+ wait_for_receiver();
+ continue;
+ }
+
+ cur_flist = first_flist;
+ if (cur_flist->ndx_start != 0) {
+ fp = dir_flist->files[cur_flist->parent_ndx];
+ if (!(fp->flags & FLAG_MISSING_DIR)) {
+ f_name(fp, fbuf);
+ if (!(fp->mode & S_IWUSR))
+ do_chmod(fbuf, fp->mode);
+ if (preserve_times && !omit_dir_times) {
+ set_modtime(fbuf, fp->modtime,
+ fp->mode);
+ }
+ }
+ } else if (relative_paths && implied_dirs
+ && preserve_times && !omit_dir_times) {
+ /* Set mtime on implied dirs */
+ for (i = 0; i < cur_flist->count; i++) {
+ fp = cur_flist->files[i];
+ if (!S_ISDIR(fp->mode)
+ || fp->flags & (FLAG_XFER_DIR|FLAG_MISSING_DIR))
+ continue;
+ f_name(fp, fbuf);
+ set_modtime(fbuf, fp->modtime, fp->mode);
+ }
+ }
+
+ flist_free(first_flist); /* updates cur_flist & first_flist */
+
+ if (!read_batch)
+ write_ndx(f_out, NDX_DONE);
+ }
+ } while ((cur_flist = next_flist) != NULL);