Fixed failing hunks.
[rsync/rsync-patches.git] / checksum-seed.diff
1 --- options.c   6 May 2004 21:08:01 -0000       1.148
2 +++ options.c   8 May 2004 18:32:36 -0000
3 @@ -290,6 +290,7 @@ void usage(enum logcode F)
4    rprintf(F,"     --bwlimit=KBPS          limit I/O bandwidth, KBytes per second\n");
5    rprintf(F,"     --write-batch=PREFIX    write batch fileset starting with PREFIX\n");
6    rprintf(F,"     --read-batch=PREFIX     read batch fileset starting with PREFIX\n");
7 +  rprintf(F,"     --checksum-seed=NUM     set block/file checksum seed\n");
8  #ifdef INET6
9    rprintf(F," -4  --ipv4                  prefer IPv4\n");
10    rprintf(F," -6  --ipv6                  prefer IPv6\n");
11 @@ -386,6 +387,7 @@ static struct poptOption long_options[] 
12    {"from0",           '0', POPT_ARG_NONE,   &eol_nulls, 0, 0, 0},
13    {"no-implied-dirs",  0,  POPT_ARG_VAL,    &implied_dirs, 0, 0, 0 },
14    {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
15 +  {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
16  #ifdef INET6
17    {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
18    {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
19 @@ -908,6 +910,12 @@ void server_options(char **args,int *arg
20  
21         if (modify_window_set) {
22                 if (asprintf(&arg, "--modify-window=%d", modify_window) < 0)
23 +                       goto oom;
24 +               args[ac++] = arg;
25 +       }
26 +
27 +       if (checksum_seed) {
28 +               if (asprintf(&arg, "--checksum_seed=%d", checksum_seed) < 0)
29                         goto oom;
30                 args[ac++] = arg;
31         }
32 --- rsync.yo    7 May 2004 00:18:37 -0000       1.169
33 +++ rsync.yo    8 May 2004 18:32:36 -0000
34 @@ -348,6 +348,7 @@ verb(
35       --bwlimit=KBPS          limit I/O bandwidth, KBytes per second
36       --write-batch=PREFIX    write batch fileset starting with PREFIX
37       --read-batch=PREFIX     read batch fileset starting with PREFIX
38 +     --checksum-seed=NUM     set block/file checksum seed
39   -4  --ipv4                  prefer IPv4
40   -6  --ipv6                  prefer IPv6
41   -h, --help                  show this help screen
42 @@ -907,6 +908,20 @@ listen for connections.  One of these op
43  versions of Linux to work around an IPv6 bug in the kernel (if you see
44  an "address already in use" error when nothing else is using the port,
45  try specifying --ipv6 or --ipv4 when starting the daemon).
46 +
47 +dit(bf(--checksum-seed=NUM)) Set the MD4 checksum seed to the integer
48 +NUM.  This 4 byte checksum seed is included in each block and file
49 +MD4 checksum calculation.  By default the checksum seed is generated
50 +by the server and defaults to the current time(), or 32761 if
51 +bf(--write-batch) or bf(--read-batch) are specified.  This option
52 +is used to set a specific checksum seed, which is useful for
53 +applications that want repeatable block and file checksums, or
54 +in the case where the user wants a more random checksum seed.
55 +Note that setting NUM to 0 causes rsync to use the default of time()
56 +for checksum seed.  Note also that --write-batch and --read-batch
57 +set the checksum seed to 32761, so --checksum-seed=NUM needs to
58 +follow these options if you want to specify a different checksum
59 +seed in batch mode.
60  
61  enddit()
62