X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e0c572c5c691da243a3187f440daab739c0b3412..b3bf9b9df95137a3a43248be9599d919b04877af:/io.c diff --git a/io.c b/io.c index 70756b8e..12e648d4 100644 --- a/io.c +++ b/io.c @@ -4,7 +4,7 @@ * Copyright (C) 1996-2001 Andrew Tridgell * Copyright (C) 1996 Paul Mackerras * Copyright (C) 2001, 2002 Martin Pool - * Copyright (C) 2003-2008 Wayne Davison + * Copyright (C) 2003-2009 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 @@ -164,6 +164,11 @@ static void got_flist_entry_status(enum festatus status, const char *buf) } break; case FES_REDO: + if (read_batch) { + if (inc_recurse) + flist->in_progress++; + break; + } if (inc_recurse) flist->to_redo++; flist_ndx_push(&redo_list, ndx); @@ -442,9 +447,14 @@ static void read_msg_fd(void) * this, sender-side deletions were mostly happening at the end. */ void increment_active_files(int ndx, int itemizing, enum logcode code) { - /* TODO: tune these limits? */ - while (active_filecnt >= (active_bytecnt >= 128*1024 ? 10 : 50)) { + while (1) { + /* TODO: tune these limits? */ + int limit = active_bytecnt >= 128*1024 ? 10 : 50; + if (active_filecnt < limit) + break; check_for_finished_files(itemizing, code, 0); + if (active_filecnt < limit) + break; if (iobuf_out_cnt) io_flush(NORMAL_FLUSH); else