Only call show_progress() and end_progress() if do_progress is set.
authorWayne Davison <wayned@samba.org>
Tue, 8 Jul 2003 16:49:10 +0000 (16:49 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 8 Jul 2003 16:49:10 +0000 (16:49 +0000)
match.c
receiver.c

diff --git a/match.c b/match.c
index 713142d..95d84b9 100644 (file)
--- a/match.c
+++ b/match.c
@@ -21,6 +21,7 @@
 
 extern int verbose;
 extern int am_server;
+extern int do_progress;
 
 typedef unsigned short tag;
 
@@ -127,7 +128,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf,
        else
                last_match = offset;
 
-       if (buf) {
+       if (buf && do_progress) {
                show_progress(last_match, buf->file_size);
 
                if (i == -1) end_progress(buf->file_size);
index fb97cc7..3e24880 100644 (file)
@@ -35,6 +35,7 @@ extern int io_error;
 extern char *tmpdir;
 extern char *compare_dest;
 extern int make_backups;
+extern int do_progress;
 extern char *backup_suffix;
 
 static struct delete_list {
@@ -244,8 +245,8 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname,
        sum_init();
        
        for (i=recv_token(f_in,&data); i != 0; i=recv_token(f_in,&data)) {
-
-               show_progress(offset, total_size);
+               if (do_progress)
+                       show_progress(offset, total_size);
 
                if (i > 0) {
                        extern int cleanup_got_literal;
@@ -295,7 +296,8 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname,
                offset += len;
        }
 
-       end_progress(total_size);
+       if (do_progress)
+               end_progress(total_size);
 
        if (fd != -1 && offset > 0 && sparse_end(fd) != 0) {
                rprintf(FERROR,"write failed on %s : %s\n",