If you try this out, please send some email to wayned@samba.org or the rsync
mailing list with your results, build changes, bug reports, etc. Thanks!
-After applying this patch, run these commands for a successful build:
+To use this patch, run these commands for a successful build:
- ./prepare-source
- ./configure (optional if already run)
+ patch -p1 <patches/threaded-receiver.diff
+ ./configure
make
--- old/Makefile.in
if (exit_code) /* Preserve first error code when recursing. */
code = exit_code;
-@@ -162,8 +155,6 @@ NORETURN void _exit_cleanup(int code, co
+@@ -157,8 +150,6 @@ NORETURN void _exit_cleanup(int code, co
if (cleanup_fname)
do_unlink(cleanup_fname);
continue;
}
-@@ -1205,7 +1209,7 @@ static void recv_generator(char *fname,
+@@ -1208,7 +1212,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1268,7 +1272,7 @@ static void recv_generator(char *fname,
+@@ -1271,7 +1275,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -1359,9 +1363,12 @@ void generate_files(int f_out, struct fi
+@@ -1362,9 +1366,12 @@ void generate_files(int f_out, struct fi
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
if (protocol_version >= 29) {
itemizing = 1;
maybe_ATTRS_REPORT = stdout_format_has_i ? 0 : ATTRS_REPORT;
-@@ -1389,7 +1396,7 @@ void generate_files(int f_out, struct fi
+@@ -1392,7 +1399,7 @@ void generate_files(int f_out, struct fi
do_delete_pass(flist);
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -1398,12 +1405,6 @@ void generate_files(int f_out, struct fi
+@@ -1401,12 +1408,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -1447,23 +1448,34 @@ void generate_files(int f_out, struct fi
+@@ -1450,23 +1451,34 @@ void generate_files(int f_out, struct fi
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
-@@ -1475,27 +1487,43 @@ void generate_files(int f_out, struct fi
+@@ -1478,27 +1490,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
}
}
- void io_flush(int flush_it_all)
+-void io_flush(int flush_it_all)
++void io_flush(UNUSED(int flush_it_all))
{
- msg2genr_flush(flush_it_all);
- msg2sndr_flush();
- if (fd_pair(error_pipe) < 0) {
- rsyserr(FERROR, errno, "pipe failed in do_recv");
+- exit_cleanup(RERR_IPC);
+- }
+-
+- io_flush(NORMAL_FLUSH);
+-
+- if ((pid = do_fork()) == -1) {
+- rsyserr(FERROR, errno, "fork failed in do_recv");
+ args.f_in = f_in;
+ args.flist = flist;
+ args.local_name = local_name;
exit_cleanup(RERR_IPC);
}
-- io_flush(NORMAL_FLUSH);
--
-- if ((pid = do_fork()) == -1) {
-- rsyserr(FERROR, errno, "fork failed in do_recv");
-- exit_cleanup(RERR_IPC);
-- }
--
- if (pid == 0) {
- close(error_pipe[0]);
- if (f_in != f_out)
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
-@@ -1302,6 +1302,7 @@ int parse_arguments(int *argc, const cha
+@@ -1306,6 +1306,7 @@ int parse_arguments(int *argc, const cha
if (do_progress && !verbose && !log_before_transfer && !am_server)
verbose = 1;