#ifdef SUPPORT_XATTRS
if (preserve_xattrs && do_xfers
&& iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
- send_xattr_request(NULL, file,
- iflags & ITEM_REPORT_XATTR ? sock_f_out : -1);
+ int fd = iflags & ITEM_REPORT_XATTR
+ && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
+ ? sock_f_out : -1;
+ send_xattr_request(NULL, file, fd);
}
#endif
} else if (ndx >= 0) {
goto cleanup;
}
}
+
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && statret == 1)
copy_xattrs(fnamecmpbuf, fname);