1 --- generator.c 11 Jun 2004 07:40:51 -0000 1.87
2 +++ generator.c 15 Jun 2004 15:35:48 -0000
3 @@ -39,6 +39,7 @@ extern int opt_ignore_existing;
4 extern int csum_length;
5 extern int ignore_times;
7 +extern OFF_T max_size;
9 extern int protocol_version;
10 extern int always_checksum;
11 @@ -345,6 +346,10 @@ void recv_generator(char *fname, struct
12 && verbose && f_out != -1)
13 rprintf(FINFO,"%s/\n",fname);
15 + } else if (max_size && file->length > max_size) {
17 + rprintf(FINFO, "%s is over max-size\n", fname);
21 if (preserve_links && S_ISLNK(file->mode)) {
22 --- options.c 7 Jun 2004 22:05:22 -0000 1.156
23 +++ options.c 15 Jun 2004 15:35:48 -0000
24 @@ -90,6 +90,7 @@ int delete_after = 0;
25 int only_existing = 0;
26 int opt_ignore_existing = 0;
29 int ignore_errors = 0;
30 int modify_window = 0;
32 @@ -139,6 +140,7 @@ char *batch_prefix = NULL;
34 static int daemon_opt; /* sets am_daemon after option error-reporting */
35 static int modify_window_set;
36 +static char *max_size_arg;
38 /** Local address to bind. As a character string because it's
39 * interpreted by the IPv6 layer: should be a numeric IP4 or ip6
40 @@ -310,7 +312,7 @@ void usage(enum logcode F)
41 enum {OPT_VERSION = 1000, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
42 OPT_DELETE_AFTER, OPT_DELETE_EXCLUDED, OPT_LINK_DEST,
43 OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW,
44 - OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT,
45 + OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT, OPT_MAX_SIZE,
46 OPT_REFUSED_BASE = 9000};
48 static struct poptOption long_options[] = {
49 @@ -364,6 +366,7 @@ static struct poptOption long_options[]
50 {"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
51 {"block-size", 'B', POPT_ARG_INT, &block_size, 0, 0, 0 },
52 {"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
53 + {"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 },
54 {"timeout", 0, POPT_ARG_INT, &io_timeout, OPT_TIMEOUT, 0, 0 },
55 {"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
56 {"compare-dest", 0, POPT_ARG_STRING, &compare_dest, 0, 0, 0 },
57 @@ -580,6 +583,32 @@ int parse_arguments(int *argc, const cha
58 checksum_seed = FIXED_CHECKSUM_SEED;
62 + for (arg = max_size_arg; isdigit(*arg); arg++) {}
64 + for (arg++; isdigit(*arg); arg++) {}
65 + if (arg == max_size_arg)
69 + max_size = atof(max_size_arg) * 1024;
72 + max_size = atof(max_size_arg) * 1024*1024;
75 + max_size = atof(max_size_arg) * 1024*1024*1024;
81 + "--max-size value is invalid.\n");
82 + exit_cleanup(RERR_SYNTAX);
88 if (io_timeout && io_timeout < select_timeout)
89 select_timeout = io_timeout;
90 @@ -884,6 +913,11 @@ void server_options(char **args,int *arg
94 + if (max_size && am_sender) {
95 + args[ac++] = "--max-size";
96 + args[ac++] = max_size_arg;
100 char *r_or_w = write_batch ? "write" : "read";
101 if (asprintf(&arg, "--%s-batch=%s", r_or_w, batch_prefix) < 0)