+ if (protocol_version < 30) {
+ if (append_mode == 1)
+ append_mode = 2;
+ if (preserve_acls && !local_server) {
+ rprintf(FERROR,
+ "--acls requires protocol 30 or higher"
+ " (negotiated %d).\n",
+ protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+ if (preserve_xattrs && !local_server) {
+ rprintf(FERROR,
+ "--xattrs requires protocol 30 or higher"
+ " (negotiated %d).\n",
+ protocol_version);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+ }
+
+ if (delete_mode && !(delete_before+delete_during+delete_after)) {
+ if (protocol_version < 30)
+ delete_before = 1;
+ else
+ delete_during = 1;
+ }
+
+ 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 (am_server) {
+ inc_recurse = allow_inc_recurse;
+ write_byte(f_out, inc_recurse);
+ } else
+ inc_recurse = read_byte(f_in);
+ if (inc_recurse && !allow_inc_recurse) {
+ /* This should only be able to happen in a batch. */
+ fprintf(stderr,
+ "Incompatible options specified for inc-recursive %s.\n",
+ read_batch ? "batch file" : "connection");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ need_messages_from_generator = 1;
+ }
+
+ if (need_unsorted_flist && (!am_sender || inc_recurse))
+ unsort_ndx = ++file_extra_cnt;
+
+ 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);
+ }
+
+
+#ifdef ICONV_OPTION
+ if (protect_args && files_from) {
+ if (am_sender)
+ filesfrom_convert = filesfrom_host && ic_send != (iconv_t)-1;
+ else
+ filesfrom_convert = !filesfrom_host && ic_recv != (iconv_t)-1;
+ }
+#endif
+
+ if (am_server) {
+ if (!checksum_seed)
+ checksum_seed = time(NULL);
+ write_int(f_out, checksum_seed);
+ } else {
+ checksum_seed = read_int(f_in);
+ }
+}