+extern int preserve_acls;
+extern int preserve_xattrs;
+extern int need_messages_from_generator;
+extern int delete_mode, delete_before, delete_during, delete_after;
+extern char *shell_cmd;
+extern char *partial_dir;
+extern char *dest_option;
+extern char *files_from;
+extern char *filesfrom_host;
+extern filter_rule_list filter_list;
+extern int need_unsorted_flist;
+#ifdef ICONV_OPTION
+extern iconv_t ic_send, ic_recv;
+extern char *iconv_opt;
+#endif
+
+/* These index values are for the file-list's extra-attribute array. */
+int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
+
+int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
+int sender_symlink_iconv = 0; /* sender should convert symlink content */
+
+#ifdef ICONV_OPTION
+int filesfrom_convert = 0;
+#endif
+
+#define CF_INC_RECURSE (1<<0)
+#define CF_SYMLINK_TIMES (1<<1)
+#define CF_SYMLINK_ICONV (1<<2)
+#define CF_TIMEOUT_ACTIVE (1<<3)
+
+static const char *client_info;
+
+/* The server makes sure that if either side only supports a pre-release
+ * version of a protocol, that both sides must speak a compatible version
+ * of that protocol for it to be advertised as available. */
+static void check_sub_protocol(void)
+{
+ char *dot;
+ int their_protocol, their_sub;
+#if SUBPROTOCOL_VERSION != 0
+ int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION;
+#else
+ int our_sub = 0;
+#endif