+ } else if (protocol_version >= 30) {
+ int compat_flags;
+ if (am_server) {
+ compat_flags = allow_inc_recurse ? CF_INC_RECURSE : 0;
+#ifdef CAN_SET_SYMLINK_TIMES
+ compat_flags |= CF_SYMLINK_TIMES;
+#endif
+#ifdef ICONV_OPTION
+ compat_flags |= CF_SYMLINK_ICONV;
+#endif
+ if (am_daemon && io_timeout && protocol_version >= 31)
+ compat_flags |= CF_TIMEOUT_ACTIVE;
+ write_byte(f_out, compat_flags);
+ if (compat_flags & CF_TIMEOUT_ACTIVE)
+ write_varint(f_out, io_timeout);
+ } else {
+ compat_flags = read_byte(f_in);
+ if (compat_flags & CF_TIMEOUT_ACTIVE) {
+ int timeout = read_varint(f_in);
+ if (!io_timeout || io_timeout > timeout) {
+ if (INFO_GTE(MISC, 2))
+ rprintf(FINFO, "Setting --timeout=%d to match server\n", timeout);
+ io_timeout = timeout;
+ }
+ }
+ }
+ /* The inc_recurse var MUST be set to 0 or 1. */
+ inc_recurse = compat_flags & CF_INC_RECURSE ? 1 : 0;
+ if (am_sender) {
+ receiver_symlink_times = am_server
+ ? strchr(client_info, 'L') != NULL
+ : !!(compat_flags & CF_SYMLINK_TIMES);
+ }
+#ifdef CAN_SET_SYMLINK_TIMES
+ else
+ receiver_symlink_times = 1;
+#endif
+#ifdef ICONV_OPTION
+ sender_symlink_iconv = iconv_opt && (am_server
+ ? local_server || strchr(client_info, 's') != NULL
+ : !!(compat_flags & CF_SYMLINK_ICONV));
+#endif
+ 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;
+#ifdef CAN_SET_SYMLINK_TIMES
+ } else if (!am_sender) {
+ receiver_symlink_times = 1;
+#endif
+ }
+
+ if (need_unsorted_flist && (!am_sender || inc_recurse))
+ unsort_ndx = ++file_extra_cnt;
+
+ if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
+ int rflags = FILTRULE_NO_PREFIXES | FILTRULE_DIRECTORY;
+ if (!am_sender || protocol_version >= 30)
+ rflags |= FILTRULE_PERISHABLE;
+ parse_filter_str(&filter_list, partial_dir, rule_template(rflags), 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;