Improved the incremental sending of file lists in two ways: (1)
[rsync/rsync.git] / sender.c
index 1370970..cab7e23 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -3,12 +3,11 @@
  *
  * Copyright (C) 1996 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
- * Copyright (C) 2003, 2004, 2005, 2006, 2007 Wayne Davison
+ * Copyright (C) 2003-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -45,6 +44,8 @@ extern int write_batch;
 extern struct stats stats;
 extern struct file_list *cur_flist, *first_flist;
 
+#define FILECNT_LOOKAHEAD 1000
+
 /**
  * @file
  *
@@ -181,7 +182,7 @@ void send_files(int f_in, int f_out)
 
        while (1) {
                if (inc_recurse)
-                       send_extra_file_list(f_out, 1000);
+                       send_extra_file_list(f_out, FILECNT_LOOKAHEAD);
 
                /* This call also sets cur_flist. */
                ndx = read_ndx_and_attrs(f_in, f_out, &iflags,
@@ -202,6 +203,9 @@ void send_files(int f_in, int f_out)
                        continue;
                }
 
+               if (inc_recurse)
+                       send_extra_file_list(f_out, FILECNT_LOOKAHEAD);
+
                file = cur_flist->files[ndx - cur_flist->ndx_start];
                if (F_ROOTDIR(file)) {
                        path = F_ROOTDIR(file);