+ if (protocol_version >= 29) {
+ itemizing = 1;
+ code = daemon_log_format_has_i ? 0 : FLOG;
+ maybe_PERMS_REPORT = log_format_has_i ? 0 : PERMS_REPORT;
+ } else if (am_daemon) {
+ itemizing = daemon_log_format_has_i && !dry_run;
+ code = itemizing || dry_run ? FCLIENT : FINFO;
+ maybe_PERMS_REPORT = PERMS_REPORT;
+ } else if (!am_server) {
+ itemizing = log_format_has_i;
+ code = itemizing ? 0 : FINFO;
+ maybe_PERMS_REPORT = log_format_has_i ? 0 : PERMS_REPORT;
+ } else {
+ itemizing = 0;
+ code = FINFO;
+ maybe_PERMS_REPORT = PERMS_REPORT;
+ }
+
+ if (!fname) {
+ if (fuzzy_dirlist) {
+ flist_free(fuzzy_dirlist);
+ fuzzy_dirlist = NULL;
+ fuzzy_dirname = NULL;
+ }
+ if (missing_below >= 0) {
+ dry_run--;
+ missing_below = -1;
+ }
+ return;
+ }
+
+ if (verbose > 2) {
+ rprintf(FINFO, "recv_generator(%s,%d)\n",
+ safe_fname(fname), ndx);
+ }
+
+ if (server_filter_list.head) {
+ if (excluded_below >= 0) {
+ if (file->dir.depth > excluded_below)
+ goto skipping;
+ excluded_below = -1;
+ }
+ if (check_filter(&server_filter_list, fname,
+ S_ISDIR(file->mode)) < 0) {
+ if (S_ISDIR(file->mode))
+ excluded_below = file->dir.depth;
+ skipping:
+ if (verbose) {
+ rprintf(FINFO,
+ "skipping server-excluded file \"%s\"\n",
+ safe_fname(fname));
+ }
+ return;
+ }
+ }
+
+ if (missing_below >= 0 && file->dir.depth <= missing_below) {
+ dry_run--;
+ missing_below = -1;
+ }
+ if (dry_run > 1) {
+ statret = -1;
+ stat_errno = ENOENT;
+ } else {
+ if (fuzzy_basis && S_ISREG(file->mode)) {
+ char *dn = file->dirname ? file->dirname : ".";
+ /* Yes, identical dirnames are guaranteed to have
+ * identical pointers at this point. */
+ if (fuzzy_dirname != dn) {
+ if (fuzzy_dirlist)
+ flist_free(fuzzy_dirlist);
+ fuzzy_dirname = dn;
+ fuzzy_dirlist = get_dirlist(fuzzy_dirname, 1);
+ }
+ }