X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/3ea6e0e7a1a3938acd6ce455b71d816a80b1eaca..ba2133d6add082b059728074febdac6c520a4351:/flist.c diff --git a/flist.c b/flist.c index 0834fe71..700d9f71 100644 --- a/flist.c +++ b/flist.c @@ -4,12 +4,11 @@ * Copyright (C) 1996 Andrew Tridgell * Copyright (C) 1996 Paul Mackerras * Copyright (C) 2001, 2002 Martin Pool - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Wayne Davison + * Copyright (C) 2002-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 @@ -1278,16 +1277,20 @@ void send_extra_file_list(int f, int at_least) char fbuf[MAXPATHLEN]; struct file_list *flist; int64 start_write; - int past_and_present, save_io_error = io_error; + int future_cnt, save_io_error = io_error; if (send_dir_ndx < 0) return; /* Keep sending data until we have the requested number of * files in the upcoming file-lists. */ - past_and_present = cur_flist->ndx_start - first_flist->ndx_start - + cur_flist->count; - while (file_total - past_and_present < at_least) { + if (cur_flist->next) { + flist = first_flist->prev; /* the newest flist */ + future_cnt = flist->count + + flist->ndx_start - cur_flist->next->ndx_start; + } else + future_cnt = 0; + while (future_cnt < at_least) { struct file_struct *file = dir_flist->files[send_dir_ndx]; int32 *dp; int dlen; @@ -1310,6 +1313,7 @@ void send_extra_file_list(int f, int at_least) clean_flist(flist, 0, 0); file_total += flist->count; + future_cnt += flist->count; stats.flist_size += stats.total_written - start_write; stats.num_files += flist->count; if (verbose > 3)