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 |
@@ -343,7 +343,7 @@ static void print_announce_list(llist_t |
22 |
*/ |
23 |
static void print_web_seed_list(slist_t *list) |
24 |
{ |
25 |
- printf(" Web Seed URL: "); |
26 |
+ printf(" Web Seed URLs: "); |
27 |
|
28 |
if (list == NULL) { |
29 |
printf("none\n"); |
30 |
@@ -361,17 +361,20 @@ static void print_web_seed_list(slist_t |
31 |
static void dump_options(metafile_t *m) |
32 |
{ |
33 |
printf("Options:\n" |
34 |
- " Announce URLs:\n"); |
35 |
+ " Announce URLs:"); |
36 |
|
37 |
- print_announce_list(m->announce_list); |
38 |
+ if (m->announce_list) { |
39 |
+ printf("\n"); |
40 |
+ print_announce_list(m->announce_list); |
41 |
+ } else |
42 |
+ printf(" none\n"); |
43 |
|
44 |
- printf(" Torrent name: %s\n" |
45 |
- " Metafile: %s\n" |
46 |
- " Piece length: %u\n" |
47 |
- " Be verbose: yes\n", |
48 |
+ printf(" Torrent name: %s\n" |
49 |
+ " Metafile: %s\n" |
50 |
+ " Piece length: %u\n", |
51 |
m->torrent_name, m->metainfo_file_path, m->piece_length); |
52 |
|
53 |
- printf(" Write date: "); |
54 |
+ printf(" Write date: "); |
55 |
if (m->no_creation_date) |
56 |
printf("no\n"); |
57 |
else |
58 |
@@ -379,11 +382,17 @@ static void dump_options(metafile_t *m) |
59 |
|
60 |
print_web_seed_list(m->web_seed_list); |
61 |
|
62 |
- printf(" Comment: "); |
63 |
+ printf(" Comment: "); |
64 |
if (m->comment == NULL) |
65 |
- printf("none\n\n"); |
66 |
+ printf("none\n"); |
67 |
else |
68 |
- printf("\"%s\"\n\n", m->comment); |
69 |
+ printf("\"%s\"\n", m->comment); |
70 |
+ |
71 |
+ printf(" Private: "); |
72 |
+ if (m->private) |
73 |
+ printf("yes\n\n"); |
74 |
+ else |
75 |
+ printf("no\n\n"); |
76 |
} |
77 |
|
78 |
/* |
79 |
@@ -495,22 +504,25 @@ EXPORT void init(metafile_t *m, int argc |
80 |
|
81 |
/* set the correct piece length. |
82 |
default is 2^18 = 256kb. */ |
83 |
- if (m->piece_length < 15 || m->piece_length > 28) { |
84 |
+ if (m->piece_length < 15 || m->piece_length > 30) { |
85 |
fprintf(stderr, |
86 |
"The piece length must be a number between " |
87 |
- "15 and 28.\n"); |
88 |
+ "15 and 30.\n"); |
89 |
exit(EXIT_FAILURE); |
90 |
} |
91 |
m->piece_length = 1 << m->piece_length; |
92 |
|
93 |
- /* user must specify at least one announce URL as it wouldn't make |
94 |
- * any sense to have a default for this */ |
95 |
+ /* user must specify at least one announce URL when private flag set |
96 |
+ as it wouldn't make any sense to have a default for this */ |
97 |
if (m->announce_list == NULL) { |
98 |
- fprintf(stderr, "Must specify an announce URL. " |
99 |
- "Use -h for help.\n"); |
100 |
- exit(EXIT_FAILURE); |
101 |
+ if (m->private == 1) { |
102 |
+ fprintf(stderr, "Must specify an announce URL. " |
103 |
+ "Use -h for help.\n"); |
104 |
+ exit(EXIT_FAILURE); |
105 |
+ } |
106 |
+ } else { |
107 |
+ announce_last->next = NULL; |
108 |
} |
109 |
- announce_last->next = NULL; |
110 |
|
111 |
/* ..and a file or directory from which to create the torrent */ |
112 |
if (optind >= argc) { |