X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/bc3fcf1d39ca698386e09f1abc1a54178102e558..c1ff70aa47e11c5b37634479a0facee775a7b6d9:/slow-down.diff diff --git a/slow-down.diff b/slow-down.diff index 5aa0c39..ba38499 100644 --- a/slow-down.diff +++ b/slow-down.diff @@ -14,18 +14,19 @@ To use this patch, run these commands for a successful build: ./configure (optional if already run) make +based-on: a01e3b490eb36ccf9e704840e1b6683dab867550 diff --git a/flist.c b/flist.c --- a/flist.c +++ b/flist.c -@@ -68,6 +68,7 @@ extern int sanitize_paths; - extern int munge_symlinks; - extern int need_unsorted_flist; +@@ -72,6 +72,7 @@ extern int sender_symlink_iconv; + extern int output_needs_newline; + extern int sender_keeps_checksum; extern int unsort_ndx; +extern unsigned long sleep_asec; extern struct stats stats; extern char *filesfrom_host; - -@@ -1557,6 +1558,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len, + extern char *usermap, *groupmap; +@@ -1754,6 +1755,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len, } send_file_name(f, flist, fbuf, NULL, flags, filter_level); @@ -38,7 +39,7 @@ diff --git a/flist.c b/flist.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -109,6 +109,7 @@ int size_only = 0; +@@ -108,6 +108,7 @@ int size_only = 0; int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; @@ -46,19 +47,19 @@ diff --git a/options.c b/options.c size_t bwlimit_writemax = 0; int ignore_existing = 0; int ignore_non_existing = 0; -@@ -424,6 +425,7 @@ void usage(enum logcode F) +@@ -776,6 +777,7 @@ void usage(enum logcode F) rprintf(F," --password-file=FILE read daemon-access password from FILE\n"); rprintf(F," --list-only list the files instead of copying them\n"); - rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n"); + rprintf(F," --bwlimit=RATE limit socket I/O bandwidth\n"); + rprintf(F," --slow-down=USECs sleep N usec while creating the filelist\n"); rprintf(F," --write-batch=FILE write a batched update to FILE\n"); rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n"); rprintf(F," --read-batch=FILE read a batched update from FILE\n"); -@@ -604,6 +606,7 @@ static struct poptOption long_options[] = { +@@ -964,6 +966,7 @@ static struct poptOption long_options[] = { {"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 }, {"no-itemize-changes",0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 }, {"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 }, + {"slow-down", 0, POPT_ARG_LONG, &sleep_asec, 0, 0, 0 }, - {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 }, + {"bwlimit", 0, POPT_ARG_STRING, &bwlimit_arg, OPT_BWLIMIT, 0, 0 }, {"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 }, {"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 },