diff options
author | Wayne Davison <wayned@samba.org> | 2008-11-09 17:59:11 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-11-09 17:59:11 -0800 |
commit | b4de848d75b5bc289f13c4f47a4f78d4c876b1a2 (patch) | |
tree | 87dd4adf40ddd091501461f734f1e7aba1a026d0 /io.c | |
parent | 89cb47212ef1a994819814332b937cbbd131a75c (diff) | |
download | rsync-b4de848d75b5bc289f13c4f47a4f78d4c876b1a2.tar.gz rsync-b4de848d75b5bc289f13c4f47a4f78d4c876b1a2.tar.bz2 rsync-b4de848d75b5bc289f13c4f47a4f78d4c876b1a2.zip |
Avoid a potential hang when --remove-*-files is active.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -447,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 |