+ if (verbose > 2) {
+ rprintf(FINFO, "recv_generator(%s,%d)\n",
+ safe_fname(fname), ndx);
+ }
+
+ if (server_filter_list.head
+ && check_filter(&server_filter_list, fname,
+ S_ISDIR(file->mode)) < 0) {
+ 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);
+ }
+ }
+
+ statret = link_stat(fname, &st,
+ keep_dirlinks && S_ISDIR(file->mode));
+ stat_errno = errno;
+ }
+
+ if (only_existing && statret == -1 && stat_errno == ENOENT) {
+ /* we only want to update existing files */
+ if (verbose > 1) {
+ rprintf(FINFO, "not creating new file \"%s\"\n",
+ safe_fname(fname));
+ }
+ return;
+ }
+
+ if (statret == 0 && !preserve_perms
+ && S_ISDIR(st.st_mode) == S_ISDIR(file->mode)) {
+ /* if the file exists already and we aren't perserving
+ * permissions then act as though the remote end sent
+ * us the file permissions we already have */
+ file->mode = (file->mode & ~CHMOD_BITS)
+ | (st.st_mode & CHMOD_BITS);
+ }