+ if (protocol_version < 29) {
+ if (fuzzy_basis) {
+ rprintf(FERROR,
+ "--fuzzy requires protocol 29 or higher"
+ " (negotiated %d).\n",
+ protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+
+ if (basis_dir_cnt && inplace) {
+ rprintf(FERROR,
+ "%s with --inplace requires protocol 29 or higher"
+ " (negotiated %d).\n",
+ dest_option, protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+
+ if (basis_dir_cnt > 1) {
+ rprintf(FERROR,
+ "Using more than one %s option requires protocol"
+ " 29 or higher (negotiated %d).\n",
+ dest_option, protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+
+ if (prune_empty_dirs) {
+ rprintf(FERROR,
+ "--prune-empty-dirs requires protocol 29 or higher"
+ " (negotiated %d).\n",
+ protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+ } else if (protocol_version >= 30) {
+ if (recurse && !preserve_hard_links && !delete_before
+ && !delete_after && !delay_updates && !prune_empty_dirs)
+ inc_recurse = 1;
+ need_messages_from_generator = 1;
+ }
+
+ if (make_backups && !backup_dir && delete_mode && !delete_excluded
+ && (!am_server || local_server)) {
+ char *rule;
+ if (asprintf(&rule, "P%s *%s",
+ !am_sender || protocol_version >= 30 ? "p" : "",
+ backup_suffix) < 0)
+ out_of_memory("setup_protocol");
+ parse_rule(&filter_list, rule, 0, 0);
+ free(rule);
+ }
+ if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
+ int flags = MATCHFLG_NO_PREFIXES | MATCHFLG_DIRECTORY;
+ if (!am_sender || protocol_version >= 30)
+ flags |= MATCHFLG_PERISHABLE;
+ parse_rule(&filter_list, partial_dir, flags, 0);