From da1319128ac3e8d563a6959e82e471e8f5544a83 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 15 Sep 2007 15:40:57 +0000 Subject: [PATCH] - Parse hard-link info as soon as we get it in inc_recurse mode. - Improve the chances of the generator finding a match for a hard-link file in inc_recurse mode. --- generator.c | 7 +++++-- io.c | 4 ++++ main.c | 12 ++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/generator.c b/generator.c index 6f024463..438d940b 100644 --- a/generator.c +++ b/generator.c @@ -1921,9 +1921,12 @@ void generate_files(int f_out, const char *local_name) do { #ifdef SUPPORT_HARD_LINKS - if (inc_recurse && preserve_hard_links) - match_hard_links(cur_flist); + if (preserve_hard_links && inc_recurse) { + while (!flist_eof && file_total < FILECNT_LOOKAHEAD/2) + wait_for_receiver(); + } #endif + if (inc_recurse && cur_flist->ndx_start) { struct file_struct *fp = dir_flist->files[cur_flist->parent_ndx]; f_name(fp, fbuf); diff --git a/io.c b/io.c index b3f3373a..62990b97 100644 --- a/io.c +++ b/io.c @@ -377,6 +377,10 @@ static void read_msg_fd(void) } flist = recv_file_list(fd); flist->parent_ndx = IVAL(buf,0); +#ifdef SUPPORT_HARD_LINKS + if (preserve_hard_links) + match_hard_links(flist); +#endif break; case MSG_FLIST_EOF: if (len != 0 || !am_generator || !inc_recurse) diff --git a/main.c b/main.c index efcd0603..d8d34804 100644 --- a/main.c +++ b/main.c @@ -71,7 +71,7 @@ extern char *shell_cmd; extern char *batch_name; extern char *password_file; extern char curr_dir[MAXPATHLEN]; -extern struct file_list *cur_flist; +extern struct file_list *first_flist; extern struct filter_list_struct server_filter_list; int local_server = 0; @@ -721,7 +721,7 @@ static int do_recv(int f_in, int f_out, char *local_name) #ifdef SUPPORT_HARD_LINKS if (preserve_hard_links && !inc_recurse) - match_hard_links(cur_flist); + match_hard_links(first_flist); #endif if (fd_pair(error_pipe) < 0) { @@ -796,6 +796,14 @@ static int do_recv(int f_in, int f_out, char *local_name) set_msg_fd_in(error_pipe[0]); io_start_buffering_in(error_pipe[0]); +#ifdef SUPPORT_HARD_LINKS + if (preserve_hard_links && inc_recurse) { + struct file_list *flist; + for (flist = first_flist; flist; flist = flist->next) + match_hard_links(flist); + } +#endif + generate_files(f_out, local_name); handle_stats(-1); -- 2.34.1