Added a debug-helping option, --msgs2stderr, than should help all
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index 7344086..39eab69 100644 (file)
--- a/main.c
+++ b/main.c
@@ -37,11 +37,13 @@ extern int am_daemon;
 extern int inc_recurse;
 extern int blocking_io;
 extern int human_readable;
+extern int always_checksum;
 extern int remove_source_files;
 extern int output_needs_newline;
 extern int need_messages_from_generator;
 extern int kluge_around_eof;
 extern int got_xfer_error;
+extern int msgs2stderr;
 extern int module_id;
 extern int copy_links;
 extern int copy_dirlinks;
@@ -68,6 +70,8 @@ extern int connect_timeout;
 extern pid_t cleanup_child_pid;
 extern unsigned int module_dirlen;
 extern struct stats stats;
+extern char *stdout_format;
+extern char *logfile_format;
 extern char *filesfrom_host;
 extern char *partial_dir;
 extern char *dest_option;
@@ -85,6 +89,7 @@ int local_server = 0;
 int daemon_over_rsh = 0;
 mode_t orig_umask = 0;
 int batch_gen_fd = -1;
+int sender_keeps_checksum = 0;
 
 /* There's probably never more than at most 2 outstanding child processes,
  * but set it higher, just in case. */
@@ -856,7 +861,7 @@ static void do_server_recv(int f_in, int f_out, int argc, char *argv[])
        char *local_name = NULL;
        int negated_levels;
 
-       if (filesfrom_fd >= 0) {
+       if (filesfrom_fd >= 0 && !msgs2stderr) {
                /* We can't mix messages with files-from data on the socket,
                 * so temporarily turn off info/debug messages. */
                negate_output_levels();
@@ -1013,6 +1018,12 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
 
        if (am_sender) {
                keep_dirlinks = 0; /* Must be disabled on the sender. */
+
+               if (always_checksum
+                && (log_format_has(stdout_format, 'C')
+                 || log_format_has(logfile_format, 'C')))
+                       sender_keeps_checksum = 1;
+
                if (protocol_version >= 30)
                        io_start_multiplex_out();
                else