Add --no-whole-file and --no-blocking-io options
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index 37ab2fb..fa5ecc0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -60,6 +60,7 @@ static void report(int f)
        if (do_stats) {
                /* These come out from every process */
                show_malloc_stats();
+               show_flist_stats();
        }
 
        if (am_daemon) {
@@ -206,10 +207,11 @@ static pid_t do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int
 
                args[argc++] = rsync_path;
 
-               server_options(args,&argc);
+               if ((blocking_io == -1) && (strcmp(cmd, RSYNC_RSH) == 0))
+                       blocking_io = 1;
 
+               server_options(args,&argc);
 
-               if (strcmp(cmd, RSYNC_RSH) == 0) blocking_io = 1;
        }
 
        args[argc++] = ".";
@@ -710,7 +712,8 @@ static int start_client(int argc, char *argv[])
                if (!p) {
                        local_server = 1;
                        /* disable "rsync algorithm" when both sides local */
-                       whole_file = 1;
+                       if (whole_file == -1)
+                               whole_file = 1;
                } else if (p[1] == ':') {
                        *p = 0;
                        return start_socket_client(argv[argc-1], p+2, argc-1, argv);
@@ -803,8 +806,10 @@ int main(int argc,char *argv[])
        extern int write_batch;  /*  dw */
        extern char *batch_ext;   /*  dw */
        int orig_argc;  /* dw */
+       char **orig_argv;
 
        orig_argc = argc;   /* dw */
+       orig_argv = argv;
 
        signal(SIGUSR1, sigusr1_handler);
        signal(SIGUSR2, sigusr2_handler);
@@ -844,7 +849,7 @@ int main(int argc,char *argv[])
 
        if (write_batch) { /* dw */
            create_batch_file_ext();
-           write_batch_argvs_file(orig_argc, argc, argv);
+           write_batch_argvs_file(orig_argc, orig_argv);
        }
 
        if (read_batch) { /* dw */