Line 0
Link Here
|
|
|
1 |
--- init.c.orig 2009-08-25 18:53:22 UTC |
2 |
+++ init.c |
3 |
@@ -277,7 +277,7 @@ static void print_help() |
4 |
"Options:\n" |
5 |
#ifdef USE_LONG_OPTIONS |
6 |
"-a, --announce=<url>[,<url>]* : specify the full announce URLs\n" |
7 |
- " at least one is required\n" |
8 |
+ " at least one is required on private torrent\n" |
9 |
" additional -a adds backup trackers\n" |
10 |
"-c, --comment=<comment> : add a comment to the metainfo\n" |
11 |
"-d, --no-date : don't write the creation date\n" |
12 |
@@ -298,7 +298,7 @@ static void print_help() |
13 |
" additional -w adds more URLs\n" |
14 |
#else |
15 |
"-a <url>[,<url>]* : specify the full announce URLs\n" |
16 |
- " at least one is required\n" |
17 |
+ " at least one is required on private torrent\n" |
18 |
" additional -a adds backup trackers\n" |
19 |
"-c <comment> : add a comment to the metainfo\n" |
20 |
"-d : don't write the creation date\n" |
21 |
@@ -495,22 +495,25 @@ EXPORT void init(metafile_t *m, int argc |
22 |
|
23 |
/* set the correct piece length. |
24 |
default is 2^18 = 256kb. */ |
25 |
- if (m->piece_length < 15 || m->piece_length > 28) { |
26 |
+ if (m->piece_length < 15 || m->piece_length > 30) { |
27 |
fprintf(stderr, |
28 |
"The piece length must be a number between " |
29 |
- "15 and 28.\n"); |
30 |
+ "15 and 30.\n"); |
31 |
exit(EXIT_FAILURE); |
32 |
} |
33 |
m->piece_length = 1 << m->piece_length; |
34 |
|
35 |
- /* user must specify at least one announce URL as it wouldn't make |
36 |
- * any sense to have a default for this */ |
37 |
+ /* user must specify at least one announce URL when private flag set |
38 |
+ as it wouldn't make any sense to have a default for this */ |
39 |
if (m->announce_list == NULL) { |
40 |
- fprintf(stderr, "Must specify an announce URL. " |
41 |
- "Use -h for help.\n"); |
42 |
- exit(EXIT_FAILURE); |
43 |
+ if (m->private == 1) { |
44 |
+ fprintf(stderr, "Must specify an announce URL. " |
45 |
+ "Use -h for help.\n"); |
46 |
+ exit(EXIT_FAILURE); |
47 |
+ } |
48 |
+ } else { |
49 |
+ announce_last->next = NULL; |
50 |
} |
51 |
- announce_last->next = NULL; |
52 |
|
53 |
/* ..and a file or directory from which to create the torrent */ |
54 |
if (optind >= argc) { |