Compare commits
868 Commits
Author | SHA1 | Date | |
---|---|---|---|
8cc561775b | |||
c08f79f71e | |||
7532276a00 | |||
ee29074a30 | |||
870ace55e2 | |||
ad7447f8ae | |||
4f827a5b1d | |||
be75455b84 | |||
96d3f67436 | |||
906bce637a | |||
3c0d0dfeee | |||
2ca5802e4d | |||
f4b06e586e | |||
525806d776 | |||
ed04747517 | |||
e13d336f2f | |||
5accdd24fc | |||
5c61c28772 | |||
3a767d84df | |||
d04ce7a2b7 | |||
b312fdeac1 | |||
30c8cf7b96 | |||
c43ca7de87 | |||
826951536b | |||
5f52edf831 | |||
29bc53d618 | |||
378c855902 | |||
546a588aa5 | |||
6e517c4a19 | |||
30d3f52f30 | |||
5dee6cb3d5 | |||
2a96c9a145 | |||
6435514e0d | |||
cd7a41924d | |||
b9452546c5 | |||
4fa89d5e86 | |||
63ece7e1aa | |||
4808055054 | |||
115016e75e | |||
ee09bfac66 | |||
530a3fcd10 | |||
0010229363 | |||
d241afcbd8 | |||
615257831c | |||
36a032d249 | |||
726079e0bb | |||
66421858e7 | |||
df7b3dd861 | |||
22ea79a4ff | |||
2025fe7c20 | |||
a11c529557 | |||
edaa2fba16 | |||
110f01a55b | |||
ada39a970e | |||
8c2641703c | |||
9fcb07250d | |||
47f39d0766 | |||
bcba5af8a9 | |||
aec1b3aeef | |||
a979ed770d | |||
5485568764 | |||
6f3597cc83 | |||
1202d09966 | |||
266eb8307c | |||
8843cc2948 | |||
2c4acce0f3 | |||
87beb2ea1a | |||
9c5b7760ba | |||
6964786552 | |||
d755756ee5 | |||
fbc970e4a7 | |||
364b905790 | |||
34a1085604 | |||
c460ac8ade | |||
49a09f61a2 | |||
08b4563f49 | |||
026f62f183 | |||
2307ac5a22 | |||
2b186421a7 | |||
1dc471e07e | |||
db1fb7ccf7 | |||
e5071a3b7c | |||
e6bfe0c10b | |||
919a97d4c8 | |||
61216b638d | |||
e065d2b01e | |||
746bad3c30 | |||
5bbd61b75c | |||
27eb7e46d0 | |||
c20bef3731 | |||
d5aaff7f06 | |||
fc60768a66 | |||
2024fb1b65 | |||
617ca79b8f | |||
5081755d0b | |||
7bfb5b1bf4 | |||
8d73529fa4 | |||
a19d04d3ba | |||
a9c7748a52 | |||
41e4e952b7 | |||
c0b0b5e4c5 | |||
e424479e7e | |||
a8804f3093 | |||
6479a24bb7 | |||
8b372ad306 | |||
86791a2f1b | |||
7cf0aad388 | |||
c5ea51beec | |||
7cc8e51d73 | |||
75ba58d68c | |||
cd35b219db | |||
4a863f8ce7 | |||
24264548a6 | |||
f9e4b1a56b | |||
13b54b864e | |||
05d45fe945 | |||
2781f6035a | |||
dc3378d084 | |||
9132e94143 | |||
b61e2aa73c | |||
7fdbae3b0f | |||
4dc6fc3b5d | |||
618275b1f9 | |||
7a1111d845 | |||
3af356840e | |||
911a278926 | |||
014063700f | |||
f7c0db0454 | |||
a534d25d82 | |||
bcf3e4a2d3 | |||
0cdfbd9803 | |||
a3e5654d86 | |||
2f9364db2b | |||
5d7c9ebf82 | |||
48da98d0e4 | |||
55e994ac3c | |||
6d46a21f9f | |||
fdc83484fd | |||
6786817fff | |||
b77cd0db15 | |||
20bef76878 | |||
7a30490482 | |||
3bc2e469cc | |||
d770d3c6da | |||
339a001592 | |||
ace57a96a9 | |||
2c26b8d422 | |||
e1eafa2394 | |||
39cb51c9eb | |||
fa5016ab04 | |||
b134ef1a74 | |||
234dff888d | |||
a08c15a3ee | |||
cfa894e7b6 | |||
d6c8e64575 | |||
dc91580e30 | |||
7ec1dd7a98 | |||
82f3f7506c | |||
e26df1c26b | |||
aea77cf225 | |||
a1e3ef9c5c | |||
7aece71342 | |||
bdbde54f04 | |||
157e035710 | |||
97d9a3a4e5 | |||
cb7f111ade | |||
35f670706a | |||
3fac888fe5 | |||
d843646b4f | |||
c2b73d9fb5 | |||
9da95b8165 | |||
5bcd8efe14 | |||
027a1d748d | |||
6d6e012c19 | |||
a8db6b007f | |||
f3576e54c6 | |||
0325f6c4d2 | |||
8225ce063a | |||
c2c379c994 | |||
7344c2af47 | |||
f484ea8c64 | |||
ac790492eb | |||
9ac5fb4890 | |||
2baee7413c | |||
16bec08f09 | |||
afb3c76922 | |||
2f526b35e8 | |||
2dc32aa310 | |||
10e669165a | |||
b6cb90d731 | |||
949a8901fb | |||
d608f450af | |||
e0a1341901 | |||
2cfb03f17d | |||
4dd0f51da4 | |||
d65a3e54a2 | |||
c212eacf19 | |||
46f341d782 | |||
ab4ff5548d | |||
d4713e1e6c | |||
8a3a1466c9 | |||
a5af9dc973 | |||
049a083e42 | |||
9683a110d6 | |||
c44698f61a | |||
106bccda0e | |||
b1aafa5aaf | |||
e2e43cd534 | |||
43b4fe8300 | |||
7c3e4fd947 | |||
9916ef4d3d | |||
ad4da54bc4 | |||
2415c5a38b | |||
ecbc0a2a2d | |||
10d37a9be5 | |||
590d2e4639 | |||
806a07acc5 | |||
8258cdd6cf | |||
2fcee6e87a | |||
27587e83c8 | |||
a0d6741ff5 | |||
63562ddd48 | |||
aac96b15b0 | |||
0f502b4229 | |||
a916f970b1 | |||
7f2d0acc3b | |||
8b6751f419 | |||
70e9cf5838 | |||
24020302fd | |||
d7e2f39d25 | |||
89d0d7b266 | |||
e3c222b5c1 | |||
a199015bc9 | |||
23617f7b30 | |||
f5f02236df | |||
ad76bc378c | |||
570d8d15af | |||
e254c5f31a | |||
2a92be5946 | |||
caab860351 | |||
32861b7ce9 | |||
a08802c4b6 | |||
6b51be6fae | |||
5b5c975884 | |||
605dfec5e7 | |||
71aa0cfba7 | |||
55e45c4274 | |||
8c880b2518 | |||
c43b16cfbb | |||
394903a8f0 | |||
e31c0636ab | |||
e9fe80f8e5 | |||
7671550a9f | |||
83d24fa90d | |||
3e2956da3f | |||
cf3fd01012 | |||
319071c73b | |||
ab8d9bb79b | |||
25eaf8cad7 | |||
c8f97d9c73 | |||
d3f1fe1c30 | |||
5fb01a01af | |||
617d1cd648 | |||
f672193fcf | |||
d3c490e9d7 | |||
2e8fd23f2b | |||
3eef403b04 | |||
f3b78fc82f | |||
80654b2732 | |||
05597ae914 | |||
0f1eb464e8 | |||
8745ffd42f | |||
db99e98658 | |||
9f1a663f63 | |||
db0b3da446 | |||
5d22d41201 | |||
b397de1d54 | |||
4bda79b263 | |||
697a9dbd06 | |||
accaabcfde | |||
5026cbdc8d | |||
16a14d4ebd | |||
c151352910 | |||
52e2aaa20d | |||
9df87ba167 | |||
b80f70fc54 | |||
939cdb019b | |||
fde36fe238 | |||
116be93160 | |||
40e820cabb | |||
d79387bd92 | |||
05f2a62cbb | |||
78a965dc90 | |||
5b603d6627 | |||
e93d2046d3 | |||
995871db8a | |||
501535f196 | |||
91e854e99c | |||
9b05d8e774 | |||
e70793c3bc | |||
abb2603bea | |||
c91218be27 | |||
9eab44128a | |||
f98101afa6 | |||
4fae7a8cb6 | |||
26cf1922db | |||
c087b0695f | |||
16930d2004 | |||
33939e7cfb | |||
e759ef5865 | |||
2be1b1ece4 | |||
1820a29aed | |||
ee9f85d53c | |||
afbb1dbe86 | |||
9244bd6b0f | |||
6bb4403207 | |||
24ebd503d4 | |||
285a5eed35 | |||
26aebe6a0f | |||
ca9f174171 | |||
ffbced22b3 | |||
45ca459ceb | |||
5a539f0619 | |||
c6cef72cb7 | |||
8081d053cc | |||
efdc8e5df0 | |||
b4911a2b2f | |||
7b70210c9a | |||
e3353df8bb | |||
25285fc059 | |||
7720f71e44 | |||
1657ac5357 | |||
299214aa1d | |||
5fd4488e08 | |||
87fcaf2651 | |||
f6b9cf6f21 | |||
eae18e61b7 | |||
96735f2543 | |||
54459d3b5c | |||
82444f9e7b | |||
3d8365a473 | |||
e2dc9715d2 | |||
d4f1230b37 | |||
7701693d37 | |||
b6704fce4e | |||
39a68d4a2b | |||
94633899d7 | |||
c45bc1554f | |||
789c8edc45 | |||
e0b44f43e3 | |||
b45069e377 | |||
c3a156ce4b | |||
ee5cc099ed | |||
f189587153 | |||
a1fb5ef6ed | |||
8c2550c39a | |||
abd96a920f | |||
1d3f0fe96c | |||
49a6cdbda6 | |||
2700028da7 | |||
51a1564566 | |||
bd068058c3 | |||
4591f77928 | |||
4f70a7d0fe | |||
6d67848096 | |||
c145ed103a | |||
f265db4037 | |||
62308f26bc | |||
2b4b47eff6 | |||
04ae0e2610 | |||
cada9fae44 | |||
949aea951e | |||
cfc49ab261 | |||
0e853a3119 | |||
a0cad7e8e9 | |||
880f1866dc | |||
05d22344b5 | |||
7212f855d8 | |||
54171e4be2 | |||
a820c01ba5 | |||
9d1ae891bb | |||
2df7247e83 | |||
a109ebef28 | |||
c0135b592d | |||
b7a0aeea34 | |||
66375e25c6 | |||
85482a67f5 | |||
d7e90969d0 | |||
9012baf51e | |||
3c8355790f | |||
e9f1da85e4 | |||
58adccfd4a | |||
040f3e016e | |||
505d5f5cae | |||
2a99e2a295 | |||
49fae646e2 | |||
f7780b6745 | |||
7a59d15e9c | |||
9b141bd9dd | |||
d0d062b6f4 | |||
375118fe02 | |||
7b59ceb4ae | |||
3aebe45a7d | |||
7c236c0fa0 | |||
7a7e650ca0 | |||
7a32f8efd6 | |||
2f8b55ceda | |||
b77be20cc1 | |||
101135a99a | |||
746c1bd628 | |||
b0502b1873 | |||
6801fc667a | |||
794db19b6d | |||
d4637818be | |||
33b7dca782 | |||
d7015cf2e6 | |||
5689fa8512 | |||
25e51a945c | |||
bfd1306a56 | |||
839986db22 | |||
ed443fe0d6 | |||
390981e10c | |||
56b3e6a993 | |||
f86f2701ff | |||
63d3685652 | |||
0a93466999 | |||
81664bc776 | |||
6d60a6f833 | |||
4186894a39 | |||
cfeafacd07 | |||
9c2edf5c6a | |||
72396f0f96 | |||
45388b0d48 | |||
a8ae36c403 | |||
164b39d8df | |||
ccc95087a1 | |||
b97f4f8bd7 | |||
76c1f47b20 | |||
ce74e49236 | |||
977d39aeb1 | |||
a821ea2752 | |||
b97197c0fa | |||
474691927a | |||
81dcbedd17 | |||
4f5cfdee57 | |||
2c7725a8e4 | |||
0ba6482da5 | |||
4c1fd67925 | |||
25683cc0de | |||
087fd5a909 | |||
fdfbab850a | |||
f1c50b7fc3 | |||
959bf4a7f4 | |||
5dda915467 | |||
66d8fd6c2a | |||
06efe306c3 | |||
15d1b005f5 | |||
7efab75c3c | |||
a9e4248c93 | |||
5338dc5540 | |||
09d3dc8e90 | |||
3bf95e566c | |||
958a5a3c4e | |||
7b48f6387f | |||
fcd2cdb136 | |||
6b59356bc5 | |||
1c7f098d9b | |||
103c15f000 | |||
0fd55f8b07 | |||
511c1e7b9d | |||
7df3bde2ce | |||
25e6b6e6c4 | |||
cb81f2c9ba | |||
6c25f0fd16 | |||
934f3d1814 | |||
e883fd6b1b | |||
e3b300e978 | |||
03a9f69739 | |||
be2dca8ee7 | |||
5c595ef289 | |||
d9534e5f23 | |||
00fa3806d8 | |||
6c5ef9acdc | |||
2db5914ba0 | |||
35a0dafb83 | |||
5f12688a90 | |||
f8d9af871a | |||
08a2b4bbf0 | |||
27a5793fd0 | |||
b1151f82b5 | |||
b6332f8313 | |||
e036cd4332 | |||
174fedc2e6 | |||
4803e60db4 | |||
abb62b93e3 | |||
95bb322cd7 | |||
670b4033cb | |||
715ae13997 | |||
77b88ab59d | |||
64235bd745 | |||
0a1960461a | |||
11249657ac | |||
188ac4f730 | |||
865116b3f4 | |||
9f28c06e9e | |||
3cd6520758 | |||
da1a50bfeb | |||
9ec79f50fa | |||
b15392ea85 | |||
b8339e72b0 | |||
6eaec7fd44 | |||
9e8f2ce771 | |||
e8e6f6f531 | |||
f16ba8ee06 | |||
76f11859b2 | |||
5be21a19db | |||
043359dd40 | |||
1b95b00b44 | |||
eaaf6af31d | |||
d8d50aaf41 | |||
5fcddd581e | |||
f1a9613a92 | |||
a2ce10759c | |||
5065aec773 | |||
25fc64933a | |||
bbdd54efc8 | |||
92597baab9 | |||
62786dcc09 | |||
c012e5bf17 | |||
5ed29b6c27 | |||
2d5decd943 | |||
9d167dc83a | |||
afe8394658 | |||
72db6d1a08 | |||
9d0e300924 | |||
4f548b7b27 | |||
cbd50372e4 | |||
3caee8bc71 | |||
6c64faf0ba | |||
65290f1ed7 | |||
498af5d203 | |||
883b53de0a | |||
cefc1f130d | |||
b2a137c5bc | |||
62f056f884 | |||
3944ea53d2 | |||
d372ea753f | |||
2528cd205d | |||
afd54fc212 | |||
8e7a9fc513 | |||
acb75f4212 | |||
c40b56c19d | |||
98027a06ec | |||
d92dfec1bf | |||
72a588bfbf | |||
213bc4bb71 | |||
1a01aa0ae4 | |||
0b0e3fffe4 | |||
1fc32c5e6f | |||
ba9f05ca06 | |||
629d12ade1 | |||
08929752a6 | |||
aaa5b4ca86 | |||
8d7e84494b | |||
99df95697a | |||
a877b21839 | |||
3f267693d2 | |||
30b7dbf1f7 | |||
f32d162b62 | |||
126fa320e5 | |||
ecae0b055d | |||
9bf22fb0d3 | |||
2a1d358141 | |||
579b450029 | |||
72eafe0920 | |||
f226392c9d | |||
2cd5c209f5 | |||
f0d444b32e | |||
4baff9fbab | |||
8e656427d8 | |||
aaa7302e80 | |||
33407fd5be | |||
513b93f789 | |||
08e54c515e | |||
55682810b1 | |||
ec893d09d0 | |||
f9b745a671 | |||
43b71a263c | |||
5c4672d1e3 | |||
7ca8e0c3a1 | |||
b530316850 | |||
fa92beae5a | |||
f58f703ecb | |||
6b83fc6b3b | |||
cdb390f7ce | |||
7b1caac9ac | |||
cec75fa60e | |||
eb23306b12 | |||
43f6813609 | |||
ea36b7b153 | |||
448ff4d398 | |||
e16227211f | |||
e07e329c26 | |||
a3d79aaa4e | |||
3fa9ae0b82 | |||
7feed50af4 | |||
0c0eb5765d | |||
e87ff25ef6 | |||
21e09cb0a5 | |||
04d54607ae | |||
ad8bfbdaab | |||
aca815c4aa | |||
24683c19a4 | |||
6b8dffc401 | |||
c4bb84058a | |||
c3dc76e35f | |||
993fa5c210 | |||
1cec793217 | |||
6029e1a291 | |||
7cc75c0cb9 | |||
e5248b09ab | |||
c39f047703 | |||
4562254862 | |||
8116d88aaf | |||
14362630d7 | |||
9af796a10a | |||
eeb884e8ce | |||
02baf905c6 | |||
df7029d2c2 | |||
c22b7568b1 | |||
73537d27d0 | |||
449d7ab589 | |||
0ddef91e16 | |||
b205af5a0d | |||
1e32170df2 | |||
f446a5f1fc | |||
fb21fb25ee | |||
deae0e8856 | |||
1cd54dc12e | |||
8ebc8bd209 | |||
9d11866f86 | |||
2c456c291a | |||
c5b3c2f430 | |||
e46e747ac0 | |||
e1a88c9426 | |||
23d3c33a12 | |||
ec8130f443 | |||
4b7aeb8418 | |||
18a0f01f8b | |||
df2e639692 | |||
708b3a662c | |||
4fee7844f8 | |||
891416e6b9 | |||
978cd2c484 | |||
c88c905926 | |||
bda4eb830e | |||
f5c1acc749 | |||
c4e6148b9f | |||
43029de2f3 | |||
7262c014c0 | |||
9f7bd99051 | |||
9e4f04cc18 | |||
454b2c8941 | |||
4c812c7bff | |||
f95b5324e0 | |||
64ee1b313b | |||
1ca651e803 | |||
f3a88398f2 | |||
412d641eb6 | |||
d7d058e772 | |||
278b917494 | |||
4b6989ef7b | |||
c10ea84ade | |||
0642fa8093 | |||
2db7c2bdd8 | |||
8682e7deb5 | |||
ea0747171f | |||
13349777ad | |||
ab0a5a06af | |||
6371f66677 | |||
105524d9c0 | |||
95e0492b32 | |||
234c084c2a | |||
94faf74aa4 | |||
e78dd1fdc3 | |||
38045d876d | |||
8433724452 | |||
e9f9e0dabb | |||
6bdf750c19 | |||
647a09b5b9 | |||
6144bfb437 | |||
88dbd7710a | |||
26a71232f0 | |||
f58a1768b9 | |||
125e6581e0 | |||
54105086ad | |||
3674ac2922 | |||
18c023e6f7 | |||
312ba2599f | |||
746dc6f884 | |||
edd4d4c114 | |||
56e0c3e047 | |||
1e83d1b304 | |||
74aa84b183 | |||
168c213288 | |||
d268a3852c | |||
01e87438c3 | |||
060f4e6632 | |||
3df5540a97 | |||
30dec5b9f5 | |||
43b437fc58 | |||
8e889cd292 | |||
eceac6def0 | |||
1e3d6776aa | |||
784ca67ddf | |||
0f6b49cc31 | |||
8cede2a2b2 | |||
38ed04bbd8 | |||
c393e70ca9 | |||
1c25c0f408 | |||
b7ebce48ee | |||
d6814a0489 | |||
6f24c74f8c | |||
d8389dcc46 | |||
9f939553ee | |||
529988f394 | |||
9f46aa1e18 | |||
418c1b6f96 | |||
8056fb9502 | |||
ab2e21147f | |||
6c00bb20b6 | |||
573ac357d8 | |||
5b139f9246 | |||
76d75b712e | |||
8bc2fd7e42 | |||
4533a86712 | |||
a6239e2ce3 | |||
1f8e61f480 | |||
c40f845279 | |||
aa74962263 | |||
42cbd6c12b | |||
ee51f69a5a | |||
0fb6e9cf6c | |||
e02845076d | |||
2dc3798116 | |||
fa252f5e8f | |||
580b9b450f | |||
f0730cd1c8 | |||
b045fb3a45 | |||
6c64111d7e | |||
37a2ccca95 | |||
b4615edfcc | |||
6019cf8148 | |||
e3d945201b | |||
05b17e5a00 | |||
13b3edfb07 | |||
f61372b2fd | |||
f85d8f7060 | |||
a0b4b7db86 | |||
827a92ef2f | |||
625d76b914 | |||
a1de894b64 | |||
413ab6d7e4 | |||
a3b1c79006 | |||
5a7d3ba4c8 | |||
8a1db31184 | |||
5190b2db1f | |||
820c573476 | |||
ab40454bce | |||
b65865b854 | |||
a5772e62c3 | |||
9976bea03f | |||
7997aeaca5 | |||
ba95084d27 | |||
e952e91b54 | |||
da21c0ddb7 | |||
0133711c3b | |||
6eae2cd460 | |||
9314eebc4f | |||
428cbdce2a | |||
7594c4383b | |||
e2f6911e9f | |||
9cdae03069 | |||
06946f026e | |||
d43dac5c04 | |||
b4d83b18fa | |||
f9424dbd6d | |||
e5212937af | |||
aeb6635e71 | |||
e94b478317 | |||
88216de42c | |||
1fcf707bb2 | |||
5101486fe7 | |||
7ae4d0e981 | |||
c644c128c0 | |||
2603f6fe45 | |||
957a296ca9 | |||
e4f44fa1e9 | |||
2b469567bb | |||
a2d90eebea | |||
850a8da0a9 | |||
ac6d711a99 | |||
5aa254a178 | |||
ad396adf39 | |||
05cce164f7 | |||
935b69bc71 | |||
61f800999a | |||
9833743eb9 | |||
ac65bc7302 | |||
b36f207bb2 | |||
e87a7c7bb4 | |||
7e5128bb85 | |||
0a178ec35e | |||
a5cd0bdd3f | |||
9cbf9d0422 | |||
097a05aab9 | |||
0e5b2598fb | |||
4f492e33e6 | |||
1828b2bd17 | |||
0c74e640df | |||
ffd2721627 | |||
f6ce4cb29f | |||
4863ef3360 | |||
9f7807ee10 | |||
b2285b0beb | |||
8e4f4f82a8 | |||
db2158d4c1 | |||
1c461bbeda | |||
0757f4f309 | |||
a2f287cdfe | |||
1ef448d518 | |||
f44b1a35bc | |||
26f02a4771 | |||
dc3c730937 | |||
77d45e7a3a | |||
45a59f009b | |||
dc6d6ead69 | |||
27693826a2 | |||
8a647b42d5 | |||
eba9f3c03b | |||
eacf46b367 | |||
83cacaad05 | |||
cf10451d14 | |||
44069645df | |||
4497463778 | |||
10b84418c3 | |||
fadda4ceec | |||
011a32f741 | |||
10bb3c100e | |||
2738d5851d | |||
219095404a | |||
001c361338 | |||
e21a172e95 | |||
4651b7007b | |||
5b4be5ba1b | |||
9c2c90c0b1 | |||
bdd0c3f961 | |||
b7013361c2 | |||
f73b3e522b | |||
fa6d17a1b8 | |||
c3e646ca22 | |||
fdc9e11fb4 | |||
a1ec838282 | |||
7da46517ae | |||
d8e2939307 | |||
8cad72c654 | |||
2cfc2bb60d | |||
1811e3b9cd |
@ -27,6 +27,7 @@ run I2P for the first time.
|
||||
To run I2P explicitly:
|
||||
(*nix): sh i2prouter start
|
||||
(win*): I2P.exe
|
||||
(Platforms unsupported by the wrapper - PPC, ARM, etc): sh runplain.sh
|
||||
|
||||
To stop the router (gracefully):
|
||||
lynx http://localhost:7657/configservice.jsp ("Shutdown gracefully")
|
||||
|
11
INSTALL.txt
@ -1,10 +1,18 @@
|
||||
I2P source installation instructions
|
||||
|
||||
Prerequisites to build from source:
|
||||
Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended)
|
||||
The SDK must have Pack200 support (java.util.jar.Pack200)
|
||||
Apache Ant 1.7.0 or higher
|
||||
Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed
|
||||
from the GNU gettext package http://www.gnu.org/software/gettext/
|
||||
|
||||
To build and install I2P from source, you must first build
|
||||
and package up the appropriate installer by running:
|
||||
|
||||
ant pkg
|
||||
|
||||
|
||||
This will produce a few key files:
|
||||
* install.jar: the GUI and console installer
|
||||
* i2pinstall.exe: the GUI and console installer wrapped for cross-platform execution
|
||||
@ -18,9 +26,6 @@ Or run the GUI installer:
|
||||
|
||||
Or move the update file into an existing installation directory and restart.
|
||||
|
||||
You will need to have ant installed from http://ant.apache.org/
|
||||
(1.7.0 or newer)
|
||||
|
||||
Supported JVMs:
|
||||
Windows: Latest available from http://java.sun.com/ (1.5+ supported)
|
||||
Linux: Latest available from http://java.sun.com/ (1.5+ supported)
|
||||
|
15
LICENSE.txt
@ -64,6 +64,9 @@ Public domain except as listed below:
|
||||
Copyright 2006 Gregory Rubin grrubin@gmail.com
|
||||
See licenses/LICENSE-HashCash.txt
|
||||
|
||||
GettextResource from gettext v0.18:
|
||||
Copyright (C) 2001, 2007 Free Software Foundation, Inc.
|
||||
See licenses/LICENSE-LGPLv2.1.txt
|
||||
|
||||
|
||||
Router:
|
||||
@ -80,9 +83,10 @@ Public domain except as listed below:
|
||||
|
||||
|
||||
Installer:
|
||||
Launch4j 2.0.RC3:
|
||||
Copyright (C) 2005 Grzegorz Kowal
|
||||
See licenses/LICENSE-GPLv2.txt
|
||||
Launch4j 3.0.1:
|
||||
Copyright (c) 2004, 2008 Grzegorz Kowal
|
||||
See licenses/LICENSE-Launch4j.txt (in binary packages)
|
||||
See installer/lib/launch4j/LICENSE.txt (in source packages)
|
||||
The following projects are used by Launch4j...
|
||||
MinGW binutils (http://www.mingw.org/)
|
||||
|
||||
@ -138,6 +142,7 @@ Applications:
|
||||
I2PSnark:
|
||||
Copyright (C) 2003 Mark J. Wielaard
|
||||
See licenses/LICENSE-GPLv2.txt
|
||||
Silk icons: See licenses/LICENSE-SilkIcons.txt
|
||||
|
||||
I2PTunnel:
|
||||
(c) 2003 - 2004 mihi
|
||||
@ -175,6 +180,7 @@ Applications:
|
||||
Router console:
|
||||
Public domain.
|
||||
Flag icons: public domain, courtesy mjames@gmail.com http://www.famfamfam.com/
|
||||
Silk icons: See licenses/LICENSE-SilkIcons.txt
|
||||
|
||||
GeoIP Data:
|
||||
Copyright (c) 2003 Direct Information Pvt. Ltd. All Rights Reserved.
|
||||
@ -207,6 +213,9 @@ The following applications and libraries are not used or bundled in
|
||||
binary packages, therefore the licenses are not included in binary
|
||||
distributions. See the source package for the additional license information.
|
||||
|
||||
Admin Manager:
|
||||
Public domain
|
||||
|
||||
Atalk:
|
||||
Public domain
|
||||
|
||||
|
@ -1,11 +1,14 @@
|
||||
Prerequisites to build from source:
|
||||
Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended)
|
||||
The SDK must have Pack200 support (java.util.jar.Pack200)
|
||||
Apache Ant 1.7.0 or higher
|
||||
Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed
|
||||
from the GNU gettext package http://www.gnu.org/software/gettext/
|
||||
|
||||
To build:
|
||||
ant pkg
|
||||
Run 'ant' with no arguments to see other build options.
|
||||
See http://www.i2p2.de/download.html for installation instructions.
|
||||
See INSTALL.txt or http://www.i2p2.de/download.html for installation instructions.
|
||||
|
||||
Documentation:
|
||||
http://www.i2p2.de/
|
||||
|
@ -1,43 +1,155 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
#
|
||||
# Now in the future we only need to look for '#I2P' and '#/I2P'
|
||||
# for modifications to rc.local and rc.local_shutdown.
|
||||
# I was a moron for not doing it this way in the first place :-) -- Sponge
|
||||
#
|
||||
#
|
||||
|
||||
touch /etc/rc.d/rc.local
|
||||
touch /etc/rc.d/rc.local_shutdown
|
||||
|
||||
I2PRCA=`grep -c /etc/rc.d/rc.local -e i2p`
|
||||
I2PRCB=`grep -c /etc/rc.d/rc.local_shutdown -e i2p`
|
||||
|
||||
echo
|
||||
echo -n "Check 1: /etc/rc.d/rc.local "
|
||||
I2PRCA=`grep -c /etc/rc.d/rc.local -e '/etc/rc.d/rc.i2p'`
|
||||
|
||||
if [ $I2PRCA -eq 0 ] ; then
|
||||
echo '#I2P' >> /etc/rc.d/rc.local
|
||||
echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
|
||||
echo " sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
|
||||
echo "fi" >> /etc/rc.d/rc.local
|
||||
echo "/etc/rc.d/rc.local modified."
|
||||
echo '#/I2P' >> /etc/rc.d/rc.local
|
||||
echo "modified."
|
||||
else
|
||||
echo "/etc/rc.d/rc.local looks OK"
|
||||
echo -n "looks OK so far,"
|
||||
# Fix old installs, or where people have modified.
|
||||
|
||||
echo -n " Check 1A: "
|
||||
I2PRCC=`grep -c /etc/rc.d/rc.local -e 'i2p-\*\.tmp'`
|
||||
|
||||
if [ $I2PRCC -eq 0 ] ; then
|
||||
DATA=$(cat /etc/rc.d/rc.local | sed -re 's/if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/#I2P\n\( cd \/tmp ; rm -Rf i2p-*.tmp \)\nif \[ -x \/etc\/rc.d\/rc.i2p \] ; then/')
|
||||
echo "${DATA}" > /etc/rc.d/rc.local
|
||||
echo -n "additional modifications applied,"
|
||||
else
|
||||
echo -n "looks OK so far,"
|
||||
fi
|
||||
|
||||
echo -n " Check 1B: "
|
||||
I2PRCE=`grep -c /etc/rc.d/rc.local -e 'i2p-\*\.tmp'`
|
||||
if [ $I2PRCE -eq 0 ] ; then
|
||||
DATATOP=$(cat /etc/rc.d/rc.local | sed -n '0,/i2p-\*\.tmp/p' | sed '$d' )
|
||||
DATABOT=$(cat /etc/rc.d/rc.local | sed -n '/i2p-\*\.tmp/,$p' | sed -n '/^fi/,$p' | sed "1d")
|
||||
echo "${DATATOP}" > /etc/rc.d/rc.local
|
||||
echo '#I2P' >> /etc/rc.d/rc.local
|
||||
echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
|
||||
echo " sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
|
||||
echo "fi" >> /etc/rc.d/rc.local
|
||||
echo '#/I2P' >> /etc/rc.d/rc.local
|
||||
echo "${DATABOT}" >> /etc/rc.d/rc.local
|
||||
|
||||
echo -n "additional modifications applied,"
|
||||
else
|
||||
echo -n "looks ok so far,"
|
||||
fi
|
||||
echo -n " Check 1C: "
|
||||
I2PRCF=`grep -c /etc/rc.d/rc.local -e '#/I2P'`
|
||||
if [ $I2PRCF -eq 0 ] ; then
|
||||
DATATOP=$(cat /etc/rc.d/rc.local | sed -n '0,/^#I2P/p' | sed '$d' )
|
||||
DATABOT=$(cat /etc/rc.d/rc.local | sed -n '/^#I2P/,$p' | sed -n '/^fi/,$p' | sed "1d")
|
||||
echo "${DATATOP}" > /etc/rc.d/rc.local
|
||||
echo '#I2P' >> /etc/rc.d/rc.local
|
||||
echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
|
||||
echo " sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
|
||||
echo "fi" >> /etc/rc.d/rc.local
|
||||
echo '#/I2P' >> /etc/rc.d/rc.local
|
||||
echo "${DATABOT}" >> /etc/rc.d/rc.local
|
||||
|
||||
echo -n "additional modifications applied,"
|
||||
else
|
||||
echo -n "looks ok so far,"
|
||||
fi
|
||||
echo " Done."
|
||||
fi
|
||||
|
||||
echo -n "Check 2: /etc/rc.d/rc.local_shutdown "
|
||||
I2PRCB=`grep -c /etc/rc.d/rc.local_shutdown -e '/etc/rc.d/rc.i2p'`
|
||||
if [ $I2PRCB -eq 0 ] ; then
|
||||
echo "#I2P" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
|
||||
echo " sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "fi" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "/etc/rc.d/rc.local_shutdown modified."
|
||||
echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "modified."
|
||||
else
|
||||
echo "/etc/rc.d/rc.local_shutdown looks OK"
|
||||
echo -n "looks OK so far,"
|
||||
# Fix old installs
|
||||
|
||||
echo -n " Check 1A: "
|
||||
I2PRCG=`grep -c /etc/rc.d/rc.local_shutdown -e '#I2P'`
|
||||
if [ $I2PRCG -eq 0 ] ; then
|
||||
DATATOP=$(cat /etc/rc.d/rc.local_shutdown | sed -n '0,/^if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/p' | sed '$d' )
|
||||
DATABOT=$(cat /etc/rc.d/rc.local_shutdown | sed -n '/^if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/,$p' | sed -n '/^fi/,$p' | sed "1d")
|
||||
echo "${DATATOP}" > /etc/rc.d/rc.local_shutdown
|
||||
echo '#I2P' >> /etc/rc.d/rc.local_shutdown
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
|
||||
echo " sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "fi" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "${DATABOT}" >> /etc/rc.d/rc.local_shutdown
|
||||
echo -n "additional modifications applied,"
|
||||
else
|
||||
echo -n "looks OK so far,"
|
||||
fi
|
||||
echo -n " Check 1B: "
|
||||
I2PRCH=`grep -c /etc/rc.d/rc.local_shutdown -e '#/I2P'`
|
||||
if [ $I2PRCH -eq 0 ] ; then
|
||||
DATATOP=$(cat /etc/rc.d/rc.local_shutdown | sed -n '0,/^#I2P/p' | sed '$d' )
|
||||
DATABOT=$(cat /etc/rc.d/rc.local_shutdown | sed -n '/^#I2P/,$p' | sed -n '/^fi/,$p' | sed "1d")
|
||||
echo "${DATATOP}" > /etc/rc.d/rc.local_shutdown
|
||||
echo '#I2P' >> /etc/rc.d/rc.local_shutdown
|
||||
echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
|
||||
echo " sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "fi" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
|
||||
echo "${DATABOT}" >> /etc/rc.d/rc.local_shutdown
|
||||
echo -n "additional modifications applied,"
|
||||
else
|
||||
echo -n "looks OK so far,"
|
||||
fi
|
||||
echo " Done."
|
||||
fi
|
||||
|
||||
if [ -f /etc/rc.d/rc.i2p ] ; then
|
||||
if [ -x /etc/rc.d/rc.i2p ] ; then
|
||||
chmod +x /etc/rc.d/rc.i2p.new
|
||||
fi
|
||||
echo
|
||||
# Hopefully get admin's attention.
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -e "\007" ; sleep 0.3
|
||||
echo "It apears that you already have /etc/rc.d/rc.i2p"
|
||||
echo "You may wish to replace it with /etc/rc.d/rc.i2p.new"
|
||||
echo
|
||||
echo "You should replace it with /etc/rc.d/rc.i2p.new as soon as possible"
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -ne "\007" ; sleep 0.3
|
||||
echo -e "\007" ; sleep 0.3
|
||||
else
|
||||
mv /etc/rc.d/rc.i2p.new /etc/rc.d/rc.i2p
|
||||
echo
|
||||
echo "Installation finished. The i2p start/stop script has been"
|
||||
echo "installed on /etc/rc.d directory. You should chmod +x"
|
||||
echo "installed in /etc/rc.d . You should chmod +x"
|
||||
echo '/etc/rc.d/rc.i2p to start it on boot.'
|
||||
echo
|
||||
fi
|
||||
|
@ -1,46 +1,57 @@
|
||||
#!/bin/sh
|
||||
# Heavily based on the Slackware 12.1 SlackBuild
|
||||
# Slackware build script for i2p
|
||||
|
||||
#
|
||||
# Heavily based on the Slackware 12.2 SlackBuild
|
||||
# Slackware build script for I2P
|
||||
#
|
||||
# PLEASE READ THIS:
|
||||
# Probably you will never have to update i2p packages with upgradepkg,
|
||||
# just because i2p have an auto-update function.
|
||||
# How to start i2p:
|
||||
# After installpkg command, doinst.sh will execute a postinstallation script
|
||||
# needed by i2p. After that you have to chmod +x /etc/rc.d/rc.i2p and start
|
||||
# i2p service with /etc/rc.d/rc.i2p start.
|
||||
# How to start I2P:
|
||||
# After installpkg command, doinst.sh will execute a post-installation script
|
||||
# needed by I2P. After that you have to chmod +x /etc/rc.d/rc.i2p and start
|
||||
# I2P service with /etc/rc.d/rc.i2p start.
|
||||
#
|
||||
# Now tell your browser to user this proxy: localhost on port 4444 and open
|
||||
# this page: http://localhost:7657/index.jsp
|
||||
# Here you can configure i2p, watch network status and navigate anonimously.
|
||||
#
|
||||
# Here you can configure I2P, watch network status and navigate anonimously.
|
||||
# It's suggested to subscribe to various dns host, like i2host.i2p
|
||||
# For any additional information, visit i2host.i2p and forum.i2p
|
||||
#
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=/tmp
|
||||
PKG=/$TMP/package-base-i2p
|
||||
rm -rf $PKG
|
||||
mkdir -p $PKG
|
||||
# put here installation dir, without first and last /
|
||||
# es: usr/local
|
||||
NAME=i2p-base
|
||||
VERSION=0.0.1
|
||||
VERSION=0.0.2
|
||||
BUILD=1sponge
|
||||
ARCH=noarch
|
||||
INSTALL_DIR=opt
|
||||
|
||||
# Less than slackware 13?
|
||||
SLKPLT=$(cat /etc/slackware-version | sed -re "s/(Slackware )([0-9]*)(.*)/\2/")
|
||||
if [ $SLKPLT -lt 13 ] ; then
|
||||
EXT=tgz
|
||||
else
|
||||
EXT=txz
|
||||
fi
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $PKG
|
||||
cd $PKG
|
||||
chown -R root:root .
|
||||
|
||||
mkdir -p $PKG/etc/rc.d
|
||||
mkdir -p $PKG/install
|
||||
sed "s|directory|/$INSTALL_DIR/i2p/i2prouter|g" $CWD/rc.i2p_def > $PKG/etc/rc.d/rc.i2p.new
|
||||
sed "s|directory|/$INSTALL_DIR/i2p/i2prouter|g" "$CWD/rc.i2p_def" > $PKG/etc/rc.d/rc.i2p.new
|
||||
chmod 644 $PKG/etc/rc.d/rc.i2p.new
|
||||
sed "s|directory|/$INSTALL_DIR/i2p/|g" $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat "$CWD/doinst.sh" > $PKG/install/doinst.sh
|
||||
cat "$CWD/slack-desc" > $PKG/install/slack-desc
|
||||
|
||||
cd $PKG
|
||||
#
|
||||
# Not really that important to exec this.
|
||||
#requiredbuilder -v -y -s $CWD $PKG
|
||||
# Not really that important to exec this
|
||||
# as there aren't any deps we don't know.
|
||||
#
|
||||
cat $CWD/slack-required > $PKG/install/slack-required
|
||||
makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
|
||||
# requiredbuilder -v -y -s $CWD $PKG
|
||||
#
|
||||
cat "$CWD/slack-required" > $PKG/install/slack-required
|
||||
makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.$EXT
|
||||
|
@ -9,6 +9,22 @@ i2p_stop() {
|
||||
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory stop )"
|
||||
}
|
||||
|
||||
i2p_restart() {
|
||||
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory restart)"
|
||||
}
|
||||
|
||||
i2p_status() {
|
||||
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )"
|
||||
}
|
||||
|
||||
i2p_console() {
|
||||
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory console )"
|
||||
}
|
||||
|
||||
i2p_dump() {
|
||||
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory dump )"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
i2p_start
|
||||
@ -17,11 +33,19 @@ case "$1" in
|
||||
i2p_stop
|
||||
;;
|
||||
'restart')
|
||||
i2p_stop
|
||||
i2p_start
|
||||
i2p_restart
|
||||
;;
|
||||
'status')
|
||||
i2p_status
|
||||
;;
|
||||
'console')
|
||||
i2p_console
|
||||
;;
|
||||
'dump')
|
||||
i2p_dump
|
||||
;;
|
||||
*)
|
||||
echo "usage $0 start|stop|restart"
|
||||
echo "usage $0 start|stop|restart|status|console|dump"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -1,28 +1,35 @@
|
||||
#!/bin/sh
|
||||
# Heavily based on the Slackware 12.1 SlackBuild
|
||||
# Slackware build script for i2p
|
||||
|
||||
#
|
||||
# Heavily based on the Slackware 12.2 SlackBuild
|
||||
# Slackware build script for I2P
|
||||
#
|
||||
# PLEASE READ THIS:
|
||||
# Probably you will never have to update i2p packages with upgradepkg,
|
||||
# just because i2p have an auto-update function.
|
||||
# How to start i2p:
|
||||
# After installpkg command, doinst.sh will execute a postinstallation script
|
||||
# needed by i2p. After that you have to chmod +x /etc/rc.d/rc.i2p and start
|
||||
# i2p service with /etc/rc.d/rc.i2p start.
|
||||
# Now tell your browser to user this proxy: localhost on port 4444 and open
|
||||
# this page: http://localhost:7657/index.jsp
|
||||
# Here you can configure i2p, watch network status and navigate anonimously.
|
||||
# It's suggested to subscribe to various dns host, like i2host.i2p
|
||||
# For any additional information, visit i2host.i2p and forum.i2p
|
||||
# Probably you will never have to update I2P packages with upgradepkg,
|
||||
# just because I2P has an auto-update function.
|
||||
# Really you should not ever use any "upgrade" method.
|
||||
#
|
||||
# The correct way to upgrade is to:
|
||||
# 1: install the upgrade
|
||||
# 2: remove the old package
|
||||
#
|
||||
# It is a terrible shame that upgradepkg doesn't do this, infact,
|
||||
# it would actually be the correct way for *any* package!
|
||||
#
|
||||
#
|
||||
|
||||
BUILD=1sponge
|
||||
|
||||
# put here installation dir, without first and last /
|
||||
# eg: usr/local
|
||||
INSTALL_DIR=opt
|
||||
NAME=i2p
|
||||
ARCH=noarch
|
||||
|
||||
# Less than slackware 13?
|
||||
SLKPLT=$(cat /etc/slackware-version | sed -re "s/(Slackware )([0-9]*)(.*)/\2/")
|
||||
if [ $SLKPLT -lt 13 ] ; then
|
||||
EXT=tgz
|
||||
else
|
||||
EXT=txz
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# This mess is here due to the totally moronic way i2p does versioning.
|
||||
@ -117,7 +124,7 @@ cd $PKG
|
||||
# requiredbuilder fucks up REALLY bad, and thinks java is perl?!
|
||||
# It also did not catch the shell requirements! BOOOOOOOOOOO! HISSSSSSSS!
|
||||
#
|
||||
#requiredbuilder -v -y -s $CWD $PKG
|
||||
# requiredbuilder -v -y -s $CWD $PKG
|
||||
#
|
||||
cat $CWD/slack-required > $PKG/install/slack-required
|
||||
makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
|
||||
makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.$EXT
|
||||
|
@ -1,25 +1,38 @@
|
||||
These instructions are for the 1.5 SDK.
|
||||
These instructions are for a recent Android SDK (1.6 or later)..
|
||||
Should also still work with a 1.5 SDK.
|
||||
The build file is not compatible with the 1.1 SDK any more.
|
||||
|
||||
#Download the SDK from http://developer.android.com/sdk/index.html
|
||||
#Unzip the android SDK in ../../
|
||||
#So then the android tools will be in ../../android-sdk-linux_x86-1.5_r2/tools/
|
||||
#So then the android tools will be in ../../android-sdk-linux_86/tools/
|
||||
#
|
||||
# now go to the available packages tab, check the box and click refresh,
|
||||
# and download an SDK Platform
|
||||
# Since I2P is configured to run on 1.1 or higher
|
||||
# (API 2) download that one. Otherwise you must change the
|
||||
# target in default.properties from android-2 to andriod-x
|
||||
# where x is the API version.
|
||||
|
||||
# create a file local.properties with the following line:
|
||||
# sdk-location=/path/to/your/android-sdk-linux_86
|
||||
|
||||
#then build the android apk file:
|
||||
ant debug
|
||||
|
||||
# Create the android 1.5 virtual device
|
||||
# Create the android 1.1 (API 2) virtual device
|
||||
# (don't make a custom hardware profile)
|
||||
../../android-sdk-linux_x86-1.5_r2/tools/android create avd --name i2p --target 2
|
||||
# A AVD created with the 1.5 SDK will not work with the newer tools
|
||||
../../android-sdk-linux_86/tools/android create avd --name i2p --target 2
|
||||
|
||||
#then run the emulator:
|
||||
../../android-sdk-linux_x86-1.5_r2/tools/emulator -avd i2p &
|
||||
../../android-sdk-linux_86/tools/emulator -avd i2p &
|
||||
|
||||
#then wait a couple minutes until the emulator is up
|
||||
#then install the I2P app
|
||||
ant install
|
||||
|
||||
#then run the debugger
|
||||
../../android-sdk-linux_x86-1.5_r2/tools/ddms &
|
||||
../../android-sdk-linux_86/tools/ddms &
|
||||
|
||||
#to rebuild and reinstall to emulator:
|
||||
ant reinstall
|
||||
|
@ -113,6 +113,10 @@
|
||||
<delete file="${external-libs-folder}/crypto.jar" />
|
||||
</target>
|
||||
|
||||
<!-- fix for property name change sometime after SDK 1.5 -->
|
||||
<property name="android-jar" value="${android.jar}" />
|
||||
<property name="android-aidl" value="${android.aidl}" />
|
||||
|
||||
<!--
|
||||
================================================================================
|
||||
From here down copied from SDK platforms/android-1.1/templates/android_rules.xml
|
||||
|
@ -10,7 +10,13 @@ i2np.udp.maxConnections=30
|
||||
# no I2CP
|
||||
i2p.dummyClientFacade=true
|
||||
# for now
|
||||
i2np.ntcp.enable=false
|
||||
#i2np.ntcp.enable=false
|
||||
#
|
||||
# UDP crashes the JVM, don't know why
|
||||
#
|
||||
i2np.udp.enable=false
|
||||
# no COMM at all!!!
|
||||
#i2p.vmCommSystem=true
|
||||
# not on android
|
||||
i2np.upnp.enable=false
|
||||
routerconsole.geoip.enable=false
|
||||
|
@ -69,7 +69,7 @@ public class I2PAndroid extends Activity
|
||||
|
||||
// from routerconsole ContextHelper
|
||||
List contexts = RouterContext.listContexts();
|
||||
if ( (contexts == null) || (contexts.size() <= 0) )
|
||||
if ( (contexts == null) || (contexts.isEmpty()) )
|
||||
throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
|
||||
RouterContext ctx = (RouterContext)contexts.get(0);
|
||||
|
||||
|
@ -71,4 +71,44 @@
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
<target depends="jar" description="Build BOB into a SINGLE JAR." name="onejar">
|
||||
<!-- Make needed working dirs -->
|
||||
<mkdir dir="${dist.dir}/lib" />
|
||||
<mkdir dir="${dist.dir}/classes" />
|
||||
|
||||
<!-- Copy jars -->
|
||||
<copy todir="${dist.dir}/lib" flatten="true" >
|
||||
<path>
|
||||
<pathelement path="${javac.classpath}" />
|
||||
</path>
|
||||
</copy>
|
||||
<copy todir="${dist.dir}/lib" file="../../installer/lib/jbigi/jbigi.jar" />
|
||||
|
||||
<!-- Extract the classes inside the jar files -->
|
||||
<unjar dest="${dist.dir}/classes" >
|
||||
<fileset dir="${dist.dir}/lib" >
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</unjar>
|
||||
|
||||
<!-- Recombine the classes into a new jar file -->
|
||||
<jar jarfile="${dist.dir}/lib/all-in-one.jar" >
|
||||
<fileset dir="${dist.dir}/classes" />
|
||||
</jar>
|
||||
|
||||
<!-- Clean up work area -->
|
||||
<delete dir="${dist.dir}/classes" followsymlinks="false" includeemptydirs="true"/>
|
||||
|
||||
<!-- Make the single jar file -->
|
||||
<jar jarfile="dist/BOB-one.jar" >
|
||||
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
|
||||
<zipfileset src="${dist.dir}/lib/all-in-one.jar" excludes="**/META-INF/*" />
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="net.i2p.BOB.Main" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<!-- Clean up the fake jar file -->
|
||||
<delete file="${dist.dir}/lib/all-in-one.jar" />
|
||||
</target>
|
||||
</project>
|
||||
|
@ -1,7 +0,0 @@
|
||||
compile.on.save=false
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
jaxws.endorsed.dir=/usr/local/netbeans-6.5/java2/modules/ext/jaxws21/api:/usr/local/netbeans-6.5/ide10/modules/ext/jaxb/api
|
||||
user.properties.file=/root/.netbeans/6.5/build.properties
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
|
||||
<file>file:/usblv/NetBeansProjects/wi2p.i2p/apps/BOB/src/net/i2p/BOB/BOB.java</file>
|
||||
</open-files>
|
||||
</project-private>
|
@ -1,5 +1,6 @@
|
||||
application.homepage=http://bob.i2p/
|
||||
application.title=BOB
|
||||
application.vendor=root
|
||||
application.vendor=Sponge
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=false
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=8
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=8
|
||||
@ -11,6 +12,7 @@ build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
@ -23,6 +25,7 @@ debug.test.classpath=\
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/BOB.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.build-javadoc=../../i2p.i2p/build/javadoc
|
||||
file.reference.i2p.jar=../../core/java/build/i2p.jar
|
||||
@ -33,7 +36,7 @@ file.reference.router.jar=../../router/java/build/router.jar
|
||||
file.reference.streaming.jar=../streaming/java/build/streaming.jar
|
||||
file.reference.wrapper.jar=../../installer/lib/wrapper/linux/wrapper.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
jar.compress=true
|
||||
javac.classpath=\
|
||||
${file.reference.router.jar}:\
|
||||
${file.reference.i2ptunnel.jar}:\
|
||||
@ -63,8 +66,9 @@ javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
|
||||
jnlp.codebase.type=local
|
||||
jnlp.codebase.url=file:/root/NetBeansProjects/i2p.i2p/apps/BOB/dist/
|
||||
jnlp.codebase.url=file:/usblv/NetBeansProjects/i2p.i2p/apps/BOB/dist
|
||||
jnlp.descriptor=application
|
||||
jnlp.enabled=false
|
||||
jnlp.offline-allowed=false
|
||||
|
@ -256,11 +256,13 @@ public class BOB {
|
||||
listener = new ServerSocket(Integer.parseInt(props.getProperty(PROP_BOB_PORT)), 10, InetAddress.getByName(props.getProperty(PROP_BOB_HOST)));
|
||||
Socket server = null;
|
||||
listener.setSoTimeout(500); // .5 sec
|
||||
|
||||
while (spin.get()) {
|
||||
//DoCMDS connection;
|
||||
|
||||
try {
|
||||
server = listener.accept();
|
||||
server.setKeepAlive(true);
|
||||
g = true;
|
||||
} catch (ConnectException ce) {
|
||||
g = false;
|
||||
|
@ -50,7 +50,7 @@ public class DoCMDS implements Runnable {
|
||||
|
||||
// FIX ME
|
||||
// I need a better way to do versioning, but this will do for now.
|
||||
public static final String BMAJ = "00", BMIN = "00", BREV = "08", BEXT = "";
|
||||
public static final String BMAJ = "00", BMIN = "00", BREV = "0D", BEXT = "";
|
||||
public static final String BOBversion = BMAJ + "." + BMIN + "." + BREV + BEXT;
|
||||
private Socket server;
|
||||
private Properties props;
|
||||
@ -691,6 +691,7 @@ public class DoCMDS implements Runnable {
|
||||
try {
|
||||
prikey = new ByteArrayOutputStream();
|
||||
prikey.write(net.i2p.data.Base64.decode(Arg));
|
||||
d = new Destination();
|
||||
d.fromBase64(Arg);
|
||||
} catch (Exception ex) {
|
||||
Arg = "";
|
||||
|
@ -60,20 +60,9 @@ public class I2Plistener implements Runnable {
|
||||
this._log = _log;
|
||||
this.socketManager = S;
|
||||
this.serverSocket = SS;
|
||||
// tgwatch = 1;
|
||||
this.lives = lives;
|
||||
}
|
||||
|
||||
private void rlock() throws Exception {
|
||||
database.getReadLock();
|
||||
info.getReadLock();
|
||||
}
|
||||
|
||||
private void runlock() throws Exception {
|
||||
database.releaseReadLock();
|
||||
info.releaseReadLock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply listen on I2P port, and thread connections
|
||||
*
|
||||
@ -83,8 +72,6 @@ public class I2Plistener implements Runnable {
|
||||
I2PSocket sessSocket = null;
|
||||
int conn = 0;
|
||||
try {
|
||||
die:
|
||||
{
|
||||
try {
|
||||
serverSocket.setSoTimeout(50);
|
||||
|
||||
@ -111,7 +98,6 @@ public class I2Plistener implements Runnable {
|
||||
// bad shit
|
||||
System.out.println("Exception " + e);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
serverSocket.close();
|
||||
|
@ -102,6 +102,7 @@ public class I2PtoTCP implements Runnable {
|
||||
break die;
|
||||
}
|
||||
sock = new Socket(host, port);
|
||||
sock.setKeepAlive(true);
|
||||
// make readers/writers
|
||||
in = sock.getInputStream();
|
||||
out = sock.getOutputStream();
|
||||
|
@ -104,10 +104,10 @@ public class MUXlisten implements Runnable {
|
||||
this.database.releaseReadLock();
|
||||
this.info.releaseReadLock();
|
||||
|
||||
socketManager = I2PSocketManagerFactory.createManager(prikey, Q);
|
||||
if (this.come_in) {
|
||||
this.listener = new ServerSocket(port, backlog, host);
|
||||
}
|
||||
socketManager = I2PSocketManagerFactory.createManager(prikey, Q);
|
||||
// I2PException, IOException, RuntimeException
|
||||
// To bad we can't just catch and enumerate....
|
||||
// } catch (I2PException e) {
|
||||
@ -141,8 +141,6 @@ public class MUXlisten implements Runnable {
|
||||
this.info.add("STARTING", new Boolean(false));
|
||||
this.info.releaseWriteLock();
|
||||
this.database.releaseWriteLock();
|
||||
// throw new Exception(e);
|
||||
// Debugging, I guess.
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@ -313,6 +311,19 @@ public class MUXlisten implements Runnable {
|
||||
} catch (InterruptedException ex) {
|
||||
}
|
||||
|
||||
// Hopefully nuke stuff here...
|
||||
{
|
||||
String boner = tg.getName();
|
||||
try {
|
||||
_log.warn("destroySocketManager " + boner);
|
||||
socketManager.destroySocketManager();
|
||||
_log.warn("destroySocketManager Successful" + boner);
|
||||
} catch (Exception e) {
|
||||
// nop
|
||||
_log.warn("destroySocketManager Failed" + boner);
|
||||
_log.warn(e.toString());
|
||||
}
|
||||
}
|
||||
// zero out everything.
|
||||
try {
|
||||
wlock();
|
||||
|
@ -78,23 +78,31 @@ public class TCPio implements Runnable {
|
||||
* --Sponge
|
||||
*
|
||||
* Tested with 128 bytes, and there was no performance gain.
|
||||
* 8192 bytes did lower load average across many connections.
|
||||
* Should I raise it higer? The correct thing to do would be to
|
||||
* override... perhaps use NTCP, but I2P's streaming lib lacks
|
||||
* anything NTCP compatable.
|
||||
*
|
||||
* --Sponge
|
||||
*/
|
||||
|
||||
int b;
|
||||
byte a[] = new byte[1];
|
||||
byte a[] = new byte[8192];
|
||||
try {
|
||||
try {
|
||||
while (lives.get()) {
|
||||
b = Ain.read(a, 0, 1);
|
||||
b = Ain.read(a, 0, 8192);
|
||||
if (b > 0) {
|
||||
Aout.write(a, 0, b);
|
||||
} else if (b == 0) {
|
||||
Thread.yield(); // this should act like a mini sleep.
|
||||
if (Ain.available() == 0) {
|
||||
Thread.sleep(10);
|
||||
// Will this die? We'll see.
|
||||
while(Ain.available() == 0) {
|
||||
Thread.sleep(20);
|
||||
}
|
||||
// Thread.yield(); // this should act like a mini sleep.
|
||||
// if (Ain.available() == 0) {
|
||||
// Thread.sleep(10);
|
||||
// }
|
||||
} else {
|
||||
/* according to the specs:
|
||||
*
|
||||
|
@ -64,16 +64,6 @@ public class TCPlistener implements Runnable {
|
||||
this.lives = lives;
|
||||
}
|
||||
|
||||
private void rlock() throws Exception {
|
||||
database.getReadLock();
|
||||
info.getReadLock();
|
||||
}
|
||||
|
||||
private void runlock() throws Exception {
|
||||
database.releaseReadLock();
|
||||
info.releaseReadLock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply listen on TCP port, and thread connections
|
||||
*
|
||||
@ -81,15 +71,14 @@ public class TCPlistener implements Runnable {
|
||||
public void run() {
|
||||
boolean g = false;
|
||||
int conn = 0;
|
||||
Socket server = null;
|
||||
try {
|
||||
die:
|
||||
{
|
||||
try {
|
||||
Socket server = new Socket();
|
||||
listener.setSoTimeout(50); // We don't block, we cycle and check.
|
||||
while (lives.get()) {
|
||||
try {
|
||||
server = listener.accept();
|
||||
server.setKeepAlive(true);
|
||||
g = true;
|
||||
} catch (SocketTimeoutException ste) {
|
||||
g = false;
|
||||
@ -105,7 +94,6 @@ public class TCPlistener implements Runnable {
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
listener.close();
|
||||
|
@ -146,8 +146,14 @@ public class TCPtoI2P implements Runnable {
|
||||
input = line.toLowerCase();
|
||||
Destination dest = null;
|
||||
if (input.endsWith(".i2p")) {
|
||||
try {
|
||||
dest = I2PTunnel.destFromName(input);
|
||||
line = dest.toBase64();
|
||||
} catch (NullPointerException npe) {
|
||||
// Could not find the destination!?
|
||||
Emsg("Can't find destination: " + input, out);
|
||||
return;
|
||||
}
|
||||
}
|
||||
dest = new Destination();
|
||||
dest.fromBase64(line);
|
||||
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Ragnarok
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
|
||||
import javax.servlet.GenericServlet;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
|
||||
/**
|
||||
* A wrapper for addressbook to allow it to be started as a web application.
|
||||
*
|
||||
* @author Ragnarok
|
||||
*
|
||||
*/
|
||||
public class Servlet extends GenericServlet {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
|
||||
*/
|
||||
public void service(ServletRequest request, ServletResponse response) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
|
||||
*/
|
||||
@Override
|
||||
public void init(ServletConfig config) {
|
||||
try {
|
||||
super.init(config);
|
||||
} catch (ServletException exp) {
|
||||
}
|
||||
String[] args = new String[1];
|
||||
args[0] = config.getInitParameter("home");
|
||||
DaemonThread thread = new DaemonThread(args);
|
||||
thread.setDaemon(true);
|
||||
thread.setName("Addressbook");
|
||||
thread.start();
|
||||
System.out.println("INFO: Starting Addressbook " + Daemon.VERSION);
|
||||
System.out.println("INFO: config root under " + args[0]);
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -193,7 +193,8 @@ public class AddressBook {
|
||||
(! host.endsWith(".router.i2p")) &&
|
||||
(! host.endsWith(".console.i2p")) &&
|
||||
|
||||
((dest.length() == MIN_DEST_LENGTH && dest.endsWith("AAAA")) ||
|
||||
// null cert ends with AAAA but other zero-length certs would be AA
|
||||
((dest.length() == MIN_DEST_LENGTH && dest.endsWith("AA")) ||
|
||||
(dest.length() > MIN_DEST_LENGTH && dest.length() <= MAX_DEST_LENGTH)) &&
|
||||
dest.replaceAll("[a-zA-Z0-9~-]", "").length() == 0
|
||||
;
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@ -39,6 +39,7 @@ import net.i2p.I2PAppContext;
|
||||
public class Daemon {
|
||||
public static final String VERSION = "2.0.3";
|
||||
private static final Daemon _instance = new Daemon();
|
||||
private boolean _running;
|
||||
|
||||
/**
|
||||
* Update the router and published address books using remote data from the
|
||||
@ -126,6 +127,7 @@ public class Daemon {
|
||||
}
|
||||
|
||||
public void run(String[] args) {
|
||||
_running = true;
|
||||
String settingsLocation = "config.txt";
|
||||
File homeFile;
|
||||
if (args.length > 0) {
|
||||
@ -166,7 +168,7 @@ public class Daemon {
|
||||
// Static method, and redundent Thread.currentThread().sleep(5*60*1000);
|
||||
} catch (InterruptedException ie) {}
|
||||
|
||||
while (true) {
|
||||
while (_running) {
|
||||
long delay = Long.parseLong((String) settings.get("update_delay"));
|
||||
if (delay < 1) {
|
||||
delay = 1;
|
||||
@ -179,6 +181,8 @@ public class Daemon {
|
||||
}
|
||||
} catch (InterruptedException exp) {
|
||||
}
|
||||
if (!_running)
|
||||
break;
|
||||
settings = ConfigParser.parse(settingsFile, defaultSettings);
|
||||
}
|
||||
}
|
||||
@ -192,4 +196,9 @@ public class Daemon {
|
||||
_instance.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
public static void stop() {
|
||||
_instance._running = false;
|
||||
wakeup();
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
/**
|
||||
* A thread that waits five minutes, then runs the addressbook daemon.
|
||||
@ -51,4 +51,9 @@ public class DaemonThread extends Thread {
|
||||
//}
|
||||
Daemon.main(this.args);
|
||||
}
|
||||
|
||||
public void halt() {
|
||||
Daemon.stop();
|
||||
interrupt();
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
96
apps/addressbook/java/src/net/i2p/addressbook/Servlet.java
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Ragnarok
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* A wrapper for addressbook to allow it to be started as a web application.
|
||||
*
|
||||
* This was a GenericServlet, we make it an HttpServlet solely to provide a hook
|
||||
* for SusiDNS to wake us up when the subscription list changes.
|
||||
*
|
||||
* @author Ragnarok
|
||||
*
|
||||
*/
|
||||
public class Servlet extends HttpServlet {
|
||||
private DaemonThread thread;
|
||||
private String nonce;
|
||||
private static final String PROP_NONCE = "addressbook.nonce";
|
||||
|
||||
/**
|
||||
* Hack to allow susidns to kick the daemon when the subscription list changes.
|
||||
* URL must be /addressbook/ with wakeup param set, and nonce param set from system property.
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
|
||||
*/
|
||||
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
//System.err.println("Got request nonce = " + request.getParameter("nonce"));
|
||||
if (this.thread != null && request.getParameter("wakeup") != null &&
|
||||
this.nonce != null && this.nonce.equals(request.getParameter("nonce"))) {
|
||||
//System.err.println("Sending interrupt");
|
||||
this.thread.interrupt();
|
||||
// no output
|
||||
} else {
|
||||
PrintWriter out = response.getWriter();
|
||||
out.write("I2P addressbook OK");
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
|
||||
*/
|
||||
@Override
|
||||
public void init(ServletConfig config) {
|
||||
try {
|
||||
super.init(config);
|
||||
} catch (ServletException exp) {
|
||||
System.err.println("Addressbook init exception: " + exp);
|
||||
}
|
||||
this.nonce = "" + Math.abs((new Random()).nextLong());
|
||||
// put the nonce where susidns can get it
|
||||
System.setProperty(PROP_NONCE, this.nonce);
|
||||
String[] args = new String[1];
|
||||
args[0] = config.getInitParameter("home");
|
||||
this.thread = new DaemonThread(args);
|
||||
this.thread.setDaemon(true);
|
||||
this.thread.setName("Addressbook");
|
||||
this.thread.start();
|
||||
System.out.println("INFO: Starting Addressbook " + Daemon.VERSION);
|
||||
//System.out.println("INFO: config root under " + args[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.thread.halt();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
/**
|
||||
* A subscription to a remote address book.
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package addressbook;
|
||||
package net.i2p.addressbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
@ -6,11 +6,17 @@
|
||||
<web-app>
|
||||
<servlet>
|
||||
<servlet-name>addressbook</servlet-name>
|
||||
<servlet-class>addressbook.Servlet</servlet-class>
|
||||
<servlet-class>net.i2p.addressbook.Servlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>home</param-name>
|
||||
<param-value>./addressbook</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>addressbook</servlet-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
BIN
apps/i2psnark/_icons/application.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
apps/i2psnark/_icons/book.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
apps/i2psnark/_icons/cancel.png
Normal file
After Width: | Height: | Size: 587 B |
BIN
apps/i2psnark/_icons/cd.png
Normal file
After Width: | Height: | Size: 673 B |
BIN
apps/i2psnark/_icons/clock.png
Normal file
After Width: | Height: | Size: 882 B |
BIN
apps/i2psnark/_icons/compress.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
apps/i2psnark/_icons/film.png
Normal file
After Width: | Height: | Size: 653 B |
BIN
apps/i2psnark/_icons/folder.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
apps/i2psnark/_icons/html.png
Normal file
After Width: | Height: | Size: 578 B |
BIN
apps/i2psnark/_icons/music.png
Normal file
After Width: | Height: | Size: 385 B |
BIN
apps/i2psnark/_icons/package.png
Normal file
After Width: | Height: | Size: 853 B |
BIN
apps/i2psnark/_icons/page.png
Normal file
After Width: | Height: | Size: 635 B |
BIN
apps/i2psnark/_icons/page_white.png
Normal file
After Width: | Height: | Size: 294 B |
BIN
apps/i2psnark/_icons/page_white_acrobat.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
apps/i2psnark/_icons/photo.png
Normal file
After Width: | Height: | Size: 589 B |
BIN
apps/i2psnark/_icons/plugin.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
apps/i2psnark/_icons/tick.png
Normal file
After Width: | Height: | Size: 537 B |
17
apps/i2psnark/java/bmsg.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Update messages_xx.po and messages_xx.class files,
|
||||
# from both java and jsp sources.
|
||||
# Requires installed programs xgettext, msgfmt, msgmerge, and find.
|
||||
# zzz - public domain
|
||||
#
|
||||
|
||||
## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\
|
||||
## need to cd into our orignal path - where we call sh.exe from.
|
||||
|
||||
cd $CALLFROM
|
||||
## echo $PWD
|
||||
|
||||
## except this everything is the same with bundle-message.sh
|
||||
## walking - public domain :-D
|
||||
|
||||
source bundle-messages.sh $PARAS
|
@ -37,7 +37,7 @@
|
||||
</javac>
|
||||
</target>
|
||||
<target name="jar" depends="builddep, compile">
|
||||
<jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/I2PSnarkServlet*.class">
|
||||
<jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/I2PSnarkServlet*.class **/messages_*.class">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="org.klomp.snark.Snark" />
|
||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
||||
@ -51,12 +51,45 @@
|
||||
- So we must continue to duplicate everything in the war.
|
||||
<classes dir="./build/obj" includes="**/I2PSnarkServlet*.class" />
|
||||
-->
|
||||
<target name="war" depends="jar">
|
||||
<war destfile="../i2psnark.war" webxml="../web.xml">
|
||||
<classes dir="./build/obj" includes="**/*.class" excludes="**/RunStandalone.class" />
|
||||
<target name="war" depends="jar, bundle">
|
||||
<war destfile="../i2psnark.war" webxml="../web.xml" basedir="../" includes="_icons/*" >
|
||||
<!-- include only the web stuff, as of 0.7.12 the router will add i2psnark.jar to the classpath for the war -->
|
||||
<classes dir="./build/obj" includes="**/web/*.class" />
|
||||
</war>
|
||||
</target>
|
||||
|
||||
<target name="bundle" depends="compile">
|
||||
<!-- Update the messages_*.po files.
|
||||
We need to supply the bat file for windows, and then change the fail property to true -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
</exec>
|
||||
<exec executable="sh" osfamily="mac" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
</exec>
|
||||
<exec executable="cmd" osfamily="windows" failifexecutionfails="false" >
|
||||
<arg value="/c" />
|
||||
<arg value="bundle-messages.bat" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="poupdate" depends="builddep, compile">
|
||||
<!-- Update the messages_*.po files. -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
<exec executable="cmd" osfamily="windows" failifexecutionfails="true" >
|
||||
<arg value="/c" />
|
||||
<arg value="bundle-messages.bat" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="standalone" depends="standalone_prep">
|
||||
<zip destfile="i2psnark-standalone.zip">
|
||||
<zipfileset dir="./dist/" prefix="i2psnark/" />
|
||||
@ -95,9 +128,7 @@
|
||||
<delete dir="./dist" />
|
||||
</target>
|
||||
<target name="cleandep" depends="clean">
|
||||
<ant dir="../../ministreaming/java/" target="distclean" />
|
||||
</target>
|
||||
<target name="distclean" depends="clean">
|
||||
<ant dir="../../ministreaming/java/" target="distclean" />
|
||||
</target>
|
||||
</project>
|
||||
|
26
apps/i2psnark/java/bundle-messages.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
set Callfrom=%cd%
|
||||
set Paras=%1
|
||||
|
||||
rem before calling make sure you have msys and mingw 's "bin" path
|
||||
rem in your current searching path
|
||||
rem type "set path" to check
|
||||
if not exist ..\locale\*.only goto updateALL
|
||||
|
||||
rem put a messages_xx.only(eg messages_zh.only) into locale folder
|
||||
rem this script will only touch the po file(eg zh) you specified, leaving other po files untact.
|
||||
|
||||
for %%i in (..\locale\*.only) do set PO=%%~ni
|
||||
echo [Notice] Yu choose to Ony update the choosen file: %PO%.po
|
||||
for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po-
|
||||
|
||||
call sh --login %cd%\bmsg.sh
|
||||
|
||||
for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po
|
||||
goto end
|
||||
|
||||
:updateALL
|
||||
call sh --login %cd%\bmsg.sh
|
||||
|
||||
:end
|
||||
echo End of Message Bundling
|
85
apps/i2psnark/java/bundle-messages.sh
Executable file
@ -0,0 +1,85 @@
|
||||
#
|
||||
# Update messages_xx.po and messages_xx.class files,
|
||||
# from both java and jsp sources.
|
||||
# Requires installed programs xgettext, msgfmt, msgmerge, and find.
|
||||
#
|
||||
# usage:
|
||||
# bundle-messages.sh (generates the resource bundle from the .po file)
|
||||
# bundle-messages.sh -p (updates the .po file from the source tags, then generates the resource bundle)
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
CLASS=org.klomp.snark.web.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
if [ "$1" = "-p" ]
|
||||
then
|
||||
POUPDATE=1
|
||||
fi
|
||||
|
||||
# add ../java/ so the refs will work in the po file
|
||||
JPATHS="../java/src"
|
||||
for i in ../locale/messages_*.po
|
||||
do
|
||||
# get language
|
||||
LG=${i#../locale/messages_}
|
||||
LG=${LG%.po}
|
||||
|
||||
if [ "$POUPDATE" = "1" ]
|
||||
then
|
||||
# make list of java files newer than the .po file
|
||||
find $JPATHS -name *.java -newer $i > $TMPFILE
|
||||
fi
|
||||
|
||||
if [ -s build/obj/org/klomp/snark/web/messages_$LG.class -a \
|
||||
build/obj/org/klomp/snark/web/messages_$LG.class -nt $i -a \
|
||||
! -s $TMPFILE ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$POUPDATE" = "1" ]
|
||||
then
|
||||
echo "Updating the $i file from the tags..."
|
||||
# extract strings from java and jsp files, and update messages.po files
|
||||
# translate calls must be one of the forms:
|
||||
# _("foo")
|
||||
# _x("foo")
|
||||
# To start a new translation, copy the header from an old translation to the new .po file,
|
||||
# then ant distclean poupdate.
|
||||
find $JPATHS -name *.java > $TMPFILE
|
||||
xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\
|
||||
--keyword=_ --keyword=_x \
|
||||
-o ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - xgettext failed, not updating translations'
|
||||
rm -f ${i}t
|
||||
break
|
||||
fi
|
||||
msgmerge -U --backup=none $i ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - msgmerge failed, not updating translations'
|
||||
rm -f ${i}t
|
||||
break
|
||||
fi
|
||||
rm -f ${i}t
|
||||
# so we don't do this again
|
||||
touch $i
|
||||
fi
|
||||
|
||||
echo "Generating ${CLASS}_$LG ResourceBundle..."
|
||||
|
||||
# convert to class files in build/obj
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - msgfmt failed, not updating translations'
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f $TMPFILE
|
||||
# todo: return failure
|
||||
exit 0
|
@ -25,6 +25,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.I2PException;
|
||||
import net.i2p.client.streaming.I2PServerSocket;
|
||||
import net.i2p.client.streaming.I2PSocket;
|
||||
@ -36,7 +37,7 @@ import net.i2p.util.Log;
|
||||
*/
|
||||
public class ConnectionAcceptor implements Runnable
|
||||
{
|
||||
private Log _log = new Log(ConnectionAcceptor.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(ConnectionAcceptor.class);
|
||||
private I2PServerSocket serverSocket;
|
||||
private PeerAcceptor peeracceptor;
|
||||
private Thread thread;
|
||||
|
@ -4,7 +4,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -23,11 +22,13 @@ import net.i2p.client.streaming.I2PSocketManagerFactory;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.util.ConcurrentHashSet;
|
||||
import net.i2p.util.EepGet;
|
||||
import net.i2p.util.FileUtil;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
import net.i2p.util.Translate;
|
||||
|
||||
/**
|
||||
* I2P specific helpers for I2PSnark
|
||||
@ -44,33 +45,35 @@ public class I2PSnarkUtil {
|
||||
private int _proxyPort;
|
||||
private String _i2cpHost;
|
||||
private int _i2cpPort;
|
||||
private Map _opts;
|
||||
private Map<String, String> _opts;
|
||||
private I2PSocketManager _manager;
|
||||
private boolean _configured;
|
||||
private final Set _shitlist;
|
||||
private final Set<Hash> _shitlist;
|
||||
private int _maxUploaders;
|
||||
private int _maxUpBW;
|
||||
private int _maxConnections;
|
||||
private File _tmpDir;
|
||||
private int _startupDelay;
|
||||
|
||||
public static final int DEFAULT_STARTUP_DELAY = 3;
|
||||
public static final String PROP_USE_OPENTRACKERS = "i2psnark.useOpentrackers";
|
||||
public static final boolean DEFAULT_USE_OPENTRACKERS = true;
|
||||
public static final String PROP_OPENTRACKERS = "i2psnark.opentrackers";
|
||||
public static final String DEFAULT_OPENTRACKERS = "http://tracker.welterde.i2p/a";
|
||||
public static final int DEFAULT_MAX_UP_BW = 8; //KBps
|
||||
public static final int MAX_CONNECTIONS = 16; // per torrent
|
||||
|
||||
public I2PSnarkUtil(I2PAppContext ctx) {
|
||||
_context = ctx;
|
||||
_log = _context.logManager().getLog(Snark.class);
|
||||
_opts = new HashMap();
|
||||
setProxy("127.0.0.1", 4444);
|
||||
//setProxy("127.0.0.1", 4444);
|
||||
setI2CPConfig("127.0.0.1", 7654, null);
|
||||
_shitlist = new HashSet(64);
|
||||
_shitlist = new ConcurrentHashSet();
|
||||
_configured = false;
|
||||
_maxUploaders = Snark.MAX_TOTAL_UPLOADERS;
|
||||
_maxUpBW = DEFAULT_MAX_UP_BW;
|
||||
_maxConnections = MAX_CONNECTIONS;
|
||||
_startupDelay = DEFAULT_STARTUP_DELAY;
|
||||
// This is used for both announce replies and .torrent file downloads,
|
||||
// so it must be available even if not connected to I2CP.
|
||||
// so much for multiple instances
|
||||
@ -84,6 +87,7 @@ public class I2PSnarkUtil {
|
||||
* host for no proxying)
|
||||
*
|
||||
*/
|
||||
/*****
|
||||
public void setProxy(String host, int port) {
|
||||
if ( (host != null) && (port > 0) ) {
|
||||
_shouldProxy = true;
|
||||
@ -96,6 +100,7 @@ public class I2PSnarkUtil {
|
||||
}
|
||||
_configured = true;
|
||||
}
|
||||
******/
|
||||
|
||||
public boolean configured() { return _configured; }
|
||||
|
||||
@ -125,15 +130,21 @@ public class I2PSnarkUtil {
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
public void setStartupDelay(int minutes) {
|
||||
_startupDelay = minutes;
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
public String getI2CPHost() { return _i2cpHost; }
|
||||
public int getI2CPPort() { return _i2cpPort; }
|
||||
public Map getI2CPOptions() { return _opts; }
|
||||
public Map<String, String> getI2CPOptions() { return _opts; }
|
||||
public String getEepProxyHost() { return _proxyHost; }
|
||||
public int getEepProxyPort() { return _proxyPort; }
|
||||
public boolean getEepProxySet() { return _shouldProxy; }
|
||||
public int getMaxUploaders() { return _maxUploaders; }
|
||||
public int getMaxUpBW() { return _maxUpBW; }
|
||||
public int getMaxConnections() { return _maxConnections; }
|
||||
public int getStartupDelay() { return _startupDelay; }
|
||||
|
||||
/**
|
||||
* Connect to the router, if we aren't already
|
||||
@ -186,18 +197,15 @@ public class I2PSnarkUtil {
|
||||
/** connect to the given destination */
|
||||
I2PSocket connect(PeerID peer) throws IOException {
|
||||
Hash dest = peer.getAddress().calculateHash();
|
||||
synchronized (_shitlist) {
|
||||
if (_shitlist.contains(dest))
|
||||
throw new IOException("Not trying to contact " + dest.toBase64() + ", as they are shitlisted");
|
||||
}
|
||||
try {
|
||||
I2PSocket rv = _manager.connect(peer.getAddress());
|
||||
if (rv != null) synchronized (_shitlist) { _shitlist.remove(dest); }
|
||||
if (rv != null)
|
||||
_shitlist.remove(dest);
|
||||
return rv;
|
||||
} catch (I2PException ie) {
|
||||
synchronized (_shitlist) {
|
||||
_shitlist.add(dest);
|
||||
}
|
||||
SimpleScheduler.getInstance().addEvent(new Unshitlist(dest), 10*60*1000);
|
||||
throw new IOException("Unable to reach the peer " + peer + ": " + ie.getMessage());
|
||||
}
|
||||
@ -206,7 +214,7 @@ public class I2PSnarkUtil {
|
||||
private class Unshitlist implements SimpleTimer.TimedEvent {
|
||||
private Hash _dest;
|
||||
public Unshitlist(Hash dest) { _dest = dest; }
|
||||
public void timeReached() { synchronized (_shitlist) { _shitlist.remove(_dest); } }
|
||||
public void timeReached() { _shitlist.remove(_dest); }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -357,7 +365,7 @@ public class I2PSnarkUtil {
|
||||
while (tok.hasMoreTokens())
|
||||
rv.add(tok.nextToken());
|
||||
|
||||
if (rv.size() <= 0)
|
||||
if (rv.isEmpty())
|
||||
return null;
|
||||
return rv;
|
||||
}
|
||||
@ -402,4 +410,37 @@ public class I2PSnarkUtil {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static final String BUNDLE_NAME = "org.klomp.snark.web.messages";
|
||||
|
||||
/** lang in routerconsole.lang property, else current locale */
|
||||
public String getString(String key) {
|
||||
return Translate.getString(key, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* translate a string with a parameter
|
||||
* This is a lot more expensive than getString(s, ctx), so use sparingly.
|
||||
*
|
||||
* @param s string to be translated containing {0}
|
||||
* The {0} will be replaced by the parameter.
|
||||
* Single quotes must be doubled, i.e. ' -> '' in the string.
|
||||
* @param o parameter, not translated.
|
||||
* To tranlslate parameter also, use _("foo {0} bar", _("baz"))
|
||||
* Do not double the single quotes in the parameter.
|
||||
* Use autoboxing to call with ints, longs, floats, etc.
|
||||
*/
|
||||
public String getString(String s, Object o) {
|
||||
return Translate.getString(s, o, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** {0} and {1} */
|
||||
public String getString(String s, Object o, Object o2) {
|
||||
return Translate.getString(s, o, o2, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** ngettext @since 0.7.14 */
|
||||
public String getString(int n, String s, String p) {
|
||||
return Translate.getString(n, s, p, _context, BUNDLE_NAME);
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.crypto.SHA1;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.util.Log;
|
||||
@ -47,7 +48,7 @@ import org.klomp.snark.bencode.InvalidBEncodingException;
|
||||
*/
|
||||
public class MetaInfo
|
||||
{
|
||||
private static final Log _log = new Log(MetaInfo.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(MetaInfo.class);
|
||||
private final String announce;
|
||||
private final byte[] info_hash;
|
||||
private final String name;
|
||||
|
@ -388,6 +388,7 @@ public class Peer implements Comparable
|
||||
* Sets whether or not we are interested in pieces from this peer.
|
||||
* Defaults to false. When interest is true and this peer unchokes
|
||||
* us then we start downloading from it. Has no effect when not connected.
|
||||
* @deprecated unused
|
||||
*/
|
||||
public void setInteresting(boolean interest)
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ import java.io.OutputStream;
|
||||
import java.io.SequenceInputStream;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.data.DataHelper;
|
||||
@ -41,7 +42,7 @@ import net.i2p.util.Log;
|
||||
*/
|
||||
public class PeerAcceptor
|
||||
{
|
||||
private static final Log _log = new Log(PeerAcceptor.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(PeerAcceptor.class);
|
||||
private final PeerCoordinator coordinator;
|
||||
final PeerCoordinatorSet coordinators;
|
||||
|
||||
|
@ -26,6 +26,8 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
|
||||
/**
|
||||
* TimerTask that checks for good/bad up/downloader. Works together
|
||||
* with the PeerCoordinator to select which Peers get (un)choked.
|
||||
@ -43,7 +45,7 @@ class PeerCheckerTask extends TimerTask
|
||||
this.coordinator = coordinator;
|
||||
}
|
||||
|
||||
private Random random = new Random();
|
||||
private static final Random random = I2PAppContext.getGlobalContext().random();
|
||||
|
||||
public void run()
|
||||
{
|
||||
@ -105,15 +107,15 @@ class PeerCheckerTask extends TimerTask
|
||||
peer.resetCounters();
|
||||
|
||||
_util.debug(peer + ":", Snark.DEBUG);
|
||||
_util.debug(" ul: " + upload/KILOPERSECOND
|
||||
+ " dl: " + download/KILOPERSECOND
|
||||
_util.debug(" ul: " + upload*1024/KILOPERSECOND
|
||||
+ " dl: " + download*1024/KILOPERSECOND
|
||||
+ " i: " + peer.isInterested()
|
||||
+ " I: " + peer.isInteresting()
|
||||
+ " c: " + peer.isChoking()
|
||||
+ " C: " + peer.isChoked(),
|
||||
Snark.DEBUG);
|
||||
|
||||
// Choke half of them rather than all so it isn't so drastic...
|
||||
// Choke a percentage of them rather than all so it isn't so drastic...
|
||||
// unless this torrent is over the limit all by itself.
|
||||
boolean overBWLimitChoke = upload > 0 &&
|
||||
((overBWLimit && random.nextBoolean()) ||
|
||||
|
@ -23,11 +23,12 @@ package org.klomp.snark;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
class PeerConnectionIn implements Runnable
|
||||
{
|
||||
private Log _log = new Log(PeerConnectionIn.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(PeerConnectionIn.class);
|
||||
private final Peer peer;
|
||||
private final DataInputStream din;
|
||||
|
||||
@ -129,7 +130,7 @@ class PeerConnectionIn implements Runnable
|
||||
din.readFully(bitmap);
|
||||
ps.bitfieldMessage(bitmap);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Received bitmap from " + peer + " on " + peer.metainfo.getName() + ": size=" + (i-1) + ": " + ps.bitfield);
|
||||
_log.debug("Received bitmap from " + peer + " on " + peer.metainfo.getName() + ": size=" + (i-1) /* + ": " + ps.bitfield */ );
|
||||
break;
|
||||
case 6:
|
||||
piece = din.readInt();
|
||||
|
@ -26,6 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
@ -33,7 +34,7 @@ import net.i2p.util.SimpleTimer;
|
||||
|
||||
class PeerConnectionOut implements Runnable
|
||||
{
|
||||
private Log _log = new Log(PeerConnectionOut.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(PeerConnectionOut.class);
|
||||
private final Peer peer;
|
||||
private final DataOutputStream dout;
|
||||
|
||||
@ -141,7 +142,7 @@ class PeerConnectionOut implements Runnable
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
if (m == null && sendQueue.size() > 0) {
|
||||
if (m == null && !sendQueue.isEmpty()) {
|
||||
m = (Message)sendQueue.remove(0);
|
||||
SimpleTimer.getInstance().removeEvent(m.expireEvent);
|
||||
}
|
||||
@ -151,7 +152,11 @@ class PeerConnectionOut implements Runnable
|
||||
{
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Send " + peer + ": " + m + " on " + peer.metainfo.getName());
|
||||
m.sendMessage(dout);
|
||||
|
||||
// This can block for quite a while.
|
||||
// To help get slow peers going, and track the bandwidth better,
|
||||
// move this _after_ state.uploaded() and see how it works.
|
||||
//m.sendMessage(dout);
|
||||
lastSent = System.currentTimeMillis();
|
||||
|
||||
// Remove all piece messages after sending a choke message.
|
||||
@ -159,9 +164,22 @@ class PeerConnectionOut implements Runnable
|
||||
removeMessage(Message.PIECE);
|
||||
|
||||
// XXX - Should also register overhead...
|
||||
if (m.type == Message.PIECE)
|
||||
// Don't let other clients requesting big chunks get an advantage
|
||||
// when we are seeding;
|
||||
// only count the rest of the upload after sendMessage().
|
||||
int remainder = 0;
|
||||
if (m.type == Message.PIECE) {
|
||||
if (m.len <= PeerState.PARTSIZE) {
|
||||
state.uploaded(m.len);
|
||||
} else {
|
||||
state.uploaded(PeerState.PARTSIZE);
|
||||
remainder = m.len - PeerState.PARTSIZE;
|
||||
}
|
||||
}
|
||||
|
||||
m.sendMessage(dout);
|
||||
if (remainder > 0)
|
||||
state.uploaded(remainder);
|
||||
m = null;
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@ -37,7 +38,7 @@ import net.i2p.util.Log;
|
||||
*/
|
||||
public class PeerCoordinator implements PeerListener
|
||||
{
|
||||
private final Log _log = new Log(PeerCoordinator.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(PeerCoordinator.class);
|
||||
final MetaInfo metainfo;
|
||||
final Storage storage;
|
||||
final Snark snark;
|
||||
@ -61,7 +62,7 @@ public class PeerCoordinator implements PeerListener
|
||||
private long downloaded_old[] = {-1,-1,-1,-1,-1,-1};
|
||||
|
||||
// synchronize on this when changing peers or downloaders
|
||||
final List peers = new ArrayList();
|
||||
final List<Peer> peers = new ArrayList();
|
||||
/** estimate of the peers, without requiring any synchronization */
|
||||
volatile int peerCount;
|
||||
|
||||
@ -71,7 +72,7 @@ public class PeerCoordinator implements PeerListener
|
||||
private final byte[] id;
|
||||
|
||||
// Some random wanted pieces
|
||||
private List wantedPieces;
|
||||
private List<Piece> wantedPieces;
|
||||
|
||||
private boolean halted = false;
|
||||
|
||||
@ -96,7 +97,7 @@ public class PeerCoordinator implements PeerListener
|
||||
// Install a timer to check the uploaders.
|
||||
// Randomize the first start time so multiple tasks are spread out,
|
||||
// this will help the behavior with global limits
|
||||
Random r = new Random();
|
||||
Random r = I2PAppContext.getGlobalContext().random();
|
||||
timer.schedule(new PeerCheckerTask(_util, this), (CHECK_PERIOD / 2) + r.nextInt((int) CHECK_PERIOD), CHECK_PERIOD);
|
||||
}
|
||||
|
||||
@ -116,7 +117,7 @@ public class PeerCoordinator implements PeerListener
|
||||
public CoordinatorListener getListener() { return listener; }
|
||||
|
||||
// for web page detailed stats
|
||||
public List peerList()
|
||||
public List<Peer> peerList()
|
||||
{
|
||||
synchronized(peers)
|
||||
{
|
||||
@ -134,8 +135,10 @@ public class PeerCoordinator implements PeerListener
|
||||
return storage.complete();
|
||||
}
|
||||
|
||||
/** might be wrong */
|
||||
public int getPeerCount() { return peerCount; }
|
||||
|
||||
/** should be right */
|
||||
public int getPeers()
|
||||
{
|
||||
synchronized(peers)
|
||||
@ -236,16 +239,30 @@ public class PeerCoordinator implements PeerListener
|
||||
{
|
||||
synchronized(peers)
|
||||
{
|
||||
return !halted && peers.size() < _util.getMaxConnections();
|
||||
return !halted && peers.size() < getMaxConnections();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduce max if huge pieces to keep from ooming when leeching
|
||||
* @return 512K: 16; 1M: 11; 2M: 6
|
||||
*/
|
||||
private int getMaxConnections() {
|
||||
int size = metainfo.getPieceLength(0);
|
||||
int max = _util.getMaxConnections();
|
||||
if (size <= 512*1024 || completed())
|
||||
return max;
|
||||
if (size <= 1024*1024)
|
||||
return (max + max + 2) / 3;
|
||||
return (max + 2) / 3;
|
||||
}
|
||||
|
||||
public boolean halted() { return halted; }
|
||||
|
||||
public void halt()
|
||||
{
|
||||
halted = true;
|
||||
List removed = new ArrayList();
|
||||
List<Peer> removed = new ArrayList();
|
||||
synchronized(peers)
|
||||
{
|
||||
// Stop peer checker task.
|
||||
@ -257,8 +274,8 @@ public class PeerCoordinator implements PeerListener
|
||||
peerCount = 0;
|
||||
}
|
||||
|
||||
while (removed.size() > 0) {
|
||||
Peer peer = (Peer)removed.remove(0);
|
||||
while (!removed.isEmpty()) {
|
||||
Peer peer = removed.remove(0);
|
||||
peer.disconnect();
|
||||
removePeerFromPieces(peer);
|
||||
}
|
||||
@ -294,7 +311,7 @@ public class PeerCoordinator implements PeerListener
|
||||
peer.disconnect(false); // Don't deregister this connection/peer.
|
||||
}
|
||||
// This is already checked in addPeer() but we could have gone over the limit since then
|
||||
else if (peers.size() >= _util.getMaxConnections())
|
||||
else if (peers.size() >= getMaxConnections())
|
||||
{
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Already at MAX_CONNECTIONS in connected() with peer: " + peer);
|
||||
@ -325,9 +342,9 @@ public class PeerCoordinator implements PeerListener
|
||||
// caller must synchronize on peers
|
||||
private static Peer peerIDInList(PeerID pid, List peers)
|
||||
{
|
||||
Iterator it = peers.iterator();
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while (it.hasNext()) {
|
||||
Peer cur = (Peer)it.next();
|
||||
Peer cur = it.next();
|
||||
if (pid.sameID(cur.getPeerID()))
|
||||
return cur;
|
||||
}
|
||||
@ -350,7 +367,7 @@ public class PeerCoordinator implements PeerListener
|
||||
peersize = peers.size();
|
||||
// This isn't a strict limit, as we may have several pending connections;
|
||||
// thus there is an additional check in connected()
|
||||
need_more = (!peer.isConnected()) && peersize < _util.getMaxConnections();
|
||||
need_more = (!peer.isConnected()) && peersize < getMaxConnections();
|
||||
// Check if we already have this peer before we build the connection
|
||||
Peer old = peerIDInList(peer.getPeerID(), peers);
|
||||
need_more = need_more && ((old == null) || (old.getInactiveTime() > 8*60*1000));
|
||||
@ -378,7 +395,7 @@ public class PeerCoordinator implements PeerListener
|
||||
if (peer.isConnected())
|
||||
_log.info("Add peer already connected: " + peer);
|
||||
else
|
||||
_log.info("Connections: " + peersize + "/" + _util.getMaxConnections()
|
||||
_log.info("Connections: " + peersize + "/" + getMaxConnections()
|
||||
+ " not accepting extra peer: " + peer);
|
||||
}
|
||||
return false;
|
||||
@ -391,21 +408,21 @@ public class PeerCoordinator implements PeerListener
|
||||
// linked list will contain all interested peers that we choke.
|
||||
// At the start are the peers that have us unchoked at the end the
|
||||
// other peer that are interested, but are choking us.
|
||||
List interested = new LinkedList();
|
||||
List<Peer> interested = new LinkedList();
|
||||
synchronized (peers) {
|
||||
int count = 0;
|
||||
int unchokedCount = 0;
|
||||
int maxUploaders = allowedUploaders();
|
||||
Iterator it = peers.iterator();
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Peer peer = (Peer)it.next();
|
||||
Peer peer = it.next();
|
||||
if (peer.isChoking() && peer.isInterested())
|
||||
{
|
||||
count++;
|
||||
if (uploaders < maxUploaders)
|
||||
{
|
||||
if (!peer.isChoked())
|
||||
if (peer.isInteresting() && !peer.isChoked())
|
||||
interested.add(unchokedCount++, peer);
|
||||
else
|
||||
interested.add(peer);
|
||||
@ -413,9 +430,9 @@ public class PeerCoordinator implements PeerListener
|
||||
}
|
||||
}
|
||||
|
||||
while (uploaders < maxUploaders && interested.size() > 0)
|
||||
while (uploaders < maxUploaders && !interested.isEmpty())
|
||||
{
|
||||
Peer peer = (Peer)interested.remove(0);
|
||||
Peer peer = interested.remove(0);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Unchoke: " + peer);
|
||||
peer.setChoking(false);
|
||||
@ -460,10 +477,10 @@ public class PeerCoordinator implements PeerListener
|
||||
|
||||
synchronized(wantedPieces)
|
||||
{
|
||||
Iterator it = wantedPieces.iterator();
|
||||
Iterator<Piece> it = wantedPieces.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Piece p = (Piece)it.next();
|
||||
Piece p = it.next();
|
||||
int i = p.getId();
|
||||
if (bitfield.get(i)) {
|
||||
p.addPeer(peer);
|
||||
@ -474,6 +491,13 @@ public class PeerCoordinator implements PeerListener
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This should be somewhat less than the max conns per torrent,
|
||||
* but not too much less, so a torrent doesn't get stuck near the end.
|
||||
* @since 0.7.14
|
||||
*/
|
||||
private static final int END_GAME_THRESHOLD = 8;
|
||||
|
||||
/**
|
||||
* Returns one of pieces in the given BitField that is still wanted or
|
||||
* -1 if none of the given pieces are wanted.
|
||||
@ -490,11 +514,11 @@ public class PeerCoordinator implements PeerListener
|
||||
{
|
||||
Piece piece = null;
|
||||
Collections.sort(wantedPieces); // Sort in order of rarest first.
|
||||
List requested = new ArrayList();
|
||||
Iterator it = wantedPieces.iterator();
|
||||
List<Piece> requested = new ArrayList();
|
||||
Iterator<Piece> it = wantedPieces.iterator();
|
||||
while (piece == null && it.hasNext())
|
||||
{
|
||||
Piece p = (Piece)it.next();
|
||||
Piece p = it.next();
|
||||
if (havePieces.get(p.getId()) && !p.isRequested())
|
||||
{
|
||||
piece = p;
|
||||
@ -507,12 +531,17 @@ public class PeerCoordinator implements PeerListener
|
||||
|
||||
//Only request a piece we've requested before if there's no other choice.
|
||||
if (piece == null) {
|
||||
// AND if there are almost no wanted pieces left (real end game).
|
||||
// If we do end game all the time, we generate lots of extra traffic
|
||||
// when the seeder is super-slow and all the peers are "caught up"
|
||||
if (wantedPieces.size() > END_GAME_THRESHOLD)
|
||||
return -1; // nothing to request and not in end game
|
||||
// let's not all get on the same piece
|
||||
Collections.shuffle(requested);
|
||||
Iterator it2 = requested.iterator();
|
||||
Iterator<Piece> it2 = requested.iterator();
|
||||
while (piece == null && it2.hasNext())
|
||||
{
|
||||
Piece p = (Piece)it2.next();
|
||||
Piece p = it2.next();
|
||||
if (havePieces.get(p.getId()))
|
||||
{
|
||||
piece = p;
|
||||
@ -632,11 +661,11 @@ public class PeerCoordinator implements PeerListener
|
||||
// Disconnect from other seeders when we get the last piece
|
||||
synchronized(peers)
|
||||
{
|
||||
List toDisconnect = new ArrayList();
|
||||
Iterator it = peers.iterator();
|
||||
List<Peer> toDisconnect = new ArrayList();
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Peer p = (Peer)it.next();
|
||||
Peer p = it.next();
|
||||
if (p.isConnected())
|
||||
{
|
||||
if (completed() && p.isCompleted())
|
||||
@ -648,7 +677,7 @@ public class PeerCoordinator implements PeerListener
|
||||
it = toDisconnect.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Peer p = (Peer)it.next();
|
||||
Peer p = it.next();
|
||||
p.disconnect(true);
|
||||
}
|
||||
}
|
||||
@ -714,8 +743,8 @@ public class PeerCoordinator implements PeerListener
|
||||
*/
|
||||
public void removePeerFromPieces(Peer peer) {
|
||||
synchronized(wantedPieces) {
|
||||
for(Iterator iter = wantedPieces.iterator(); iter.hasNext(); ) {
|
||||
Piece piece = (Piece)iter.next();
|
||||
for(Iterator<Piece> iter = wantedPieces.iterator(); iter.hasNext(); ) {
|
||||
Piece piece = iter.next();
|
||||
piece.removePeer(peer);
|
||||
}
|
||||
}
|
||||
@ -769,8 +798,8 @@ public class PeerCoordinator implements PeerListener
|
||||
}
|
||||
synchronized(wantedPieces)
|
||||
{
|
||||
for(Iterator iter = wantedPieces.iterator(); iter.hasNext(); ) {
|
||||
Piece piece = (Piece)iter.next();
|
||||
for(Iterator<Piece> iter = wantedPieces.iterator(); iter.hasNext(); ) {
|
||||
Piece piece = iter.next();
|
||||
if (piece.getId() == savedRequest.piece) {
|
||||
Request req = savedRequest;
|
||||
piece.setRequested(true);
|
||||
@ -795,9 +824,9 @@ public class PeerCoordinator implements PeerListener
|
||||
// see if anybody else is requesting
|
||||
synchronized (peers)
|
||||
{
|
||||
Iterator it = peers.iterator();
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while (it.hasNext()) {
|
||||
Peer p = (Peer)it.next();
|
||||
Peer p = it.next();
|
||||
if (p.equals(peer))
|
||||
continue;
|
||||
if (p.state == null)
|
||||
@ -815,9 +844,9 @@ public class PeerCoordinator implements PeerListener
|
||||
// nobody is, so mark unrequested
|
||||
synchronized(wantedPieces)
|
||||
{
|
||||
Iterator it = wantedPieces.iterator();
|
||||
Iterator<Piece> it = wantedPieces.iterator();
|
||||
while (it.hasNext()) {
|
||||
Piece p = (Piece)it.next();
|
||||
Piece p = it.next();
|
||||
if (p.getId() == piece) {
|
||||
p.setRequested(false);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
|
@ -24,11 +24,12 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
class PeerState
|
||||
{
|
||||
private Log _log = new Log(PeerState.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(PeerState.class);
|
||||
final Peer peer;
|
||||
final PeerListener listener;
|
||||
final MetaInfo metainfo;
|
||||
@ -152,7 +153,16 @@ class PeerState
|
||||
// XXX - Check for weird bitfield and disconnect?
|
||||
bitfield = new BitField(bitmap, metainfo.getPieces());
|
||||
}
|
||||
setInteresting(listener.gotBitField(peer, bitfield));
|
||||
boolean interest = listener.gotBitField(peer, bitfield);
|
||||
setInteresting(interest);
|
||||
if (bitfield.complete() && !interest) {
|
||||
// They are seeding and we are seeding,
|
||||
// why did they contact us? (robert)
|
||||
// Dump them quick before we send our whole bitmap
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Disconnecting seed that connects to seeds: " + peer);
|
||||
peer.disconnect(true);
|
||||
}
|
||||
}
|
||||
|
||||
void requestMessage(int piece, int begin, int length)
|
||||
@ -186,6 +196,7 @@ class PeerState
|
||||
|
||||
// Limit total pipelined requests to MAX_PIPELINE bytes
|
||||
// to conserve memory and prevent DOS
|
||||
// Todo: limit number of requests also? (robert 64 x 4KB)
|
||||
if (out.queuedBytes() + length > MAX_PIPELINE_BYTES)
|
||||
{
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
@ -512,8 +523,10 @@ class PeerState
|
||||
_log.debug(peer + " requests " + outstandingRequests);
|
||||
}
|
||||
|
||||
// Starts requesting first chunk of next piece. Returns true if
|
||||
// something has been added to the requests, false otherwise.
|
||||
/**
|
||||
* Starts requesting first chunk of next piece. Returns true if
|
||||
* something has been added to the requests, false otherwise.
|
||||
*/
|
||||
private boolean requestNextPiece()
|
||||
{
|
||||
// Check that we already know what the other side has.
|
||||
@ -545,6 +558,15 @@ class PeerState
|
||||
if (nextPiece != -1
|
||||
&& (lastRequest == null || lastRequest.piece != nextPiece))
|
||||
{
|
||||
// Fail safe to make sure we are interested
|
||||
// When we transition into the end game we may not be interested...
|
||||
if (!interesting) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(peer + " transition to end game, setting interesting");
|
||||
interesting = true;
|
||||
out.sendInterest(true);
|
||||
}
|
||||
|
||||
int piece_length = metainfo.getPieceLength(nextPiece);
|
||||
//Catch a common place for OOMs esp. on 1MB pieces
|
||||
byte[] bs;
|
||||
|
@ -321,7 +321,7 @@ public class Snark
|
||||
// sixteen random bytes.
|
||||
byte snark = (((3 + 7 + 10) * (1000 - 8)) / 992) - 17;
|
||||
id = new byte[20];
|
||||
Random random = new Random();
|
||||
Random random = I2PAppContext.getGlobalContext().random();
|
||||
int i;
|
||||
for (i = 0; i < 9; i++)
|
||||
id[i] = 0;
|
||||
@ -618,14 +618,14 @@ public class Snark
|
||||
command_interpreter = false;
|
||||
i++;
|
||||
}
|
||||
else if (args[i].equals("--eepproxy"))
|
||||
{
|
||||
String proxyHost = args[i+1];
|
||||
String proxyPort = args[i+2];
|
||||
if (!configured)
|
||||
util.setProxy(proxyHost, Integer.parseInt(proxyPort));
|
||||
i += 3;
|
||||
}
|
||||
//else if (args[i].equals("--eepproxy"))
|
||||
// {
|
||||
// String proxyHost = args[i+1];
|
||||
// String proxyPort = args[i+2];
|
||||
// if (!configured)
|
||||
// util.setProxy(proxyHost, Integer.parseInt(proxyPort));
|
||||
// i += 3;
|
||||
// }
|
||||
else if (args[i].equals("--i2cp"))
|
||||
{
|
||||
String i2cpHost = args[i+1];
|
||||
@ -734,7 +734,7 @@ public class Snark
|
||||
//if (debug >= INFO && t != null)
|
||||
// t.printStackTrace();
|
||||
stopTorrent();
|
||||
throw new RuntimeException("die bart die");
|
||||
throw new RuntimeException(s + (t == null ? "" : ": " + t));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@ import net.i2p.data.Base64;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.OrderedProperties;
|
||||
|
||||
/**
|
||||
* Manage multiple snarks
|
||||
@ -28,8 +29,8 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
private static SnarkManager _instance = new SnarkManager();
|
||||
public static SnarkManager instance() { return _instance; }
|
||||
|
||||
/** map of (canonical) filename to Snark instance (unsynchronized) */
|
||||
private final Map _snarks;
|
||||
/** map of (canonical) filename of the .torrent file to Snark instance (unsynchronized) */
|
||||
private final Map<String, Snark> _snarks;
|
||||
private final Object _addSnarkLock;
|
||||
private /* FIXME final FIXME */ File _configFile;
|
||||
private Properties _config;
|
||||
@ -39,12 +40,14 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
private I2PSnarkUtil _util;
|
||||
private PeerCoordinatorSet _peerCoordinatorSet;
|
||||
private ConnectionAcceptor _connectionAcceptor;
|
||||
private Thread _monitor;
|
||||
private boolean _running;
|
||||
|
||||
public static final String PROP_I2CP_HOST = "i2psnark.i2cpHost";
|
||||
public static final String PROP_I2CP_PORT = "i2psnark.i2cpPort";
|
||||
public static final String PROP_I2CP_OPTS = "i2psnark.i2cpOptions";
|
||||
public static final String PROP_EEP_HOST = "i2psnark.eepHost";
|
||||
public static final String PROP_EEP_PORT = "i2psnark.eepPort";
|
||||
//public static final String PROP_EEP_HOST = "i2psnark.eepHost";
|
||||
//public static final String PROP_EEP_PORT = "i2psnark.eepPort";
|
||||
public static final String PROP_UPLOADERS_TOTAL = "i2psnark.uploaders.total";
|
||||
public static final String PROP_UPBW_MAX = "i2psnark.upbw.max";
|
||||
public static final String PROP_DIR = "i2psnark.dir";
|
||||
@ -56,10 +59,11 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
public static final String DEFAULT_AUTO_START = "false";
|
||||
public static final String PROP_LINK_PREFIX = "i2psnark.linkPrefix";
|
||||
public static final String DEFAULT_LINK_PREFIX = "file:///";
|
||||
public static final String PROP_STARTUP_DELAY = "i2psnark.startupDelay";
|
||||
|
||||
public static final int MIN_UP_BW = 2;
|
||||
public static final int DEFAULT_MAX_UP_BW = 10;
|
||||
|
||||
public static final int DEFAULT_STARTUP_DELAY = 3;
|
||||
private SnarkManager() {
|
||||
_snarks = new HashMap();
|
||||
_addSnarkLock = new Object();
|
||||
@ -77,16 +81,23 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
* for i2cp host/port or i2psnark.dir
|
||||
*/
|
||||
public void start() {
|
||||
_running = true;
|
||||
_peerCoordinatorSet = new PeerCoordinatorSet();
|
||||
_connectionAcceptor = new ConnectionAcceptor(_util);
|
||||
int minutes = getStartupDelayMinutes();
|
||||
_messages.add("Adding torrents in " + minutes + (minutes == 1 ? " minute" : " minutes"));
|
||||
I2PAppThread monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor");
|
||||
monitor.setDaemon(true);
|
||||
monitor.start();
|
||||
_messages.add(_("Adding torrents in {0} minutes", minutes));
|
||||
_monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor", true);
|
||||
_monitor.start();
|
||||
_context.addShutdownTask(new SnarkManagerShutdown());
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
_running = false;
|
||||
_monitor.interrupt();
|
||||
_connectionAcceptor.halt();
|
||||
(new SnarkManagerShutdown()).run();
|
||||
}
|
||||
|
||||
/** hook to I2PSnarkUtil for the servlet */
|
||||
public I2PSnarkUtil util() { return _util; }
|
||||
|
||||
@ -114,7 +125,9 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
public String linkPrefix() {
|
||||
return _config.getProperty(PROP_LINK_PREFIX, DEFAULT_LINK_PREFIX + getDataDir().getAbsolutePath() + File.separatorChar);
|
||||
}
|
||||
private int getStartupDelayMinutes() { return 3; }
|
||||
private int getStartupDelayMinutes() {
|
||||
return Integer.valueOf(_config.getProperty(PROP_STARTUP_DELAY)).intValue();
|
||||
}
|
||||
public File getDataDir() {
|
||||
String dir = _config.getProperty(PROP_DIR, "i2psnark");
|
||||
File f = new File(dir);
|
||||
@ -126,7 +139,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
/** null to set initial defaults */
|
||||
public void loadConfig(String filename) {
|
||||
if (_config == null)
|
||||
_config = new Properties();
|
||||
_config = new OrderedProperties();
|
||||
if (filename != null) {
|
||||
File cfg = new File(filename);
|
||||
if (!cfg.isAbsolute())
|
||||
@ -147,16 +160,19 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
_config.setProperty(PROP_I2CP_PORT, "7654");
|
||||
if (!_config.containsKey(PROP_I2CP_OPTS))
|
||||
_config.setProperty(PROP_I2CP_OPTS, "inbound.length=2 inbound.lengthVariance=0 outbound.length=2 outbound.lengthVariance=0 inbound.quantity=3 outbound.quantity=3");
|
||||
if (!_config.containsKey(PROP_EEP_HOST))
|
||||
_config.setProperty(PROP_EEP_HOST, "127.0.0.1");
|
||||
if (!_config.containsKey(PROP_EEP_PORT))
|
||||
_config.setProperty(PROP_EEP_PORT, "4444");
|
||||
//if (!_config.containsKey(PROP_EEP_HOST))
|
||||
// _config.setProperty(PROP_EEP_HOST, "127.0.0.1");
|
||||
//if (!_config.containsKey(PROP_EEP_PORT))
|
||||
// _config.setProperty(PROP_EEP_PORT, "4444");
|
||||
if (!_config.containsKey(PROP_UPLOADERS_TOTAL))
|
||||
_config.setProperty(PROP_UPLOADERS_TOTAL, "" + Snark.MAX_TOTAL_UPLOADERS);
|
||||
if (!_config.containsKey(PROP_DIR))
|
||||
_config.setProperty(PROP_DIR, "i2psnark");
|
||||
if (!_config.containsKey(PROP_AUTO_START))
|
||||
_config.setProperty(PROP_AUTO_START, DEFAULT_AUTO_START);
|
||||
if (!_config.containsKey(PROP_STARTUP_DELAY))
|
||||
_config.setProperty(PROP_STARTUP_DELAY, "" + DEFAULT_STARTUP_DELAY);
|
||||
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@ -188,15 +204,17 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
_log.debug("Configuring with I2CP options " + i2cpOpts);
|
||||
}
|
||||
//I2PSnarkUtil.instance().setI2CPConfig("66.111.51.110", 7654, new Properties());
|
||||
String eepHost = _config.getProperty(PROP_EEP_HOST);
|
||||
int eepPort = getInt(PROP_EEP_PORT, 4444);
|
||||
if (eepHost != null)
|
||||
_util.setProxy(eepHost, eepPort);
|
||||
//String eepHost = _config.getProperty(PROP_EEP_HOST);
|
||||
//int eepPort = getInt(PROP_EEP_PORT, 4444);
|
||||
//if (eepHost != null)
|
||||
// _util.setProxy(eepHost, eepPort);
|
||||
_util.setMaxUploaders(getInt(PROP_UPLOADERS_TOTAL, Snark.MAX_TOTAL_UPLOADERS));
|
||||
_util.setMaxUpBW(getInt(PROP_UPBW_MAX, DEFAULT_MAX_UP_BW));
|
||||
_util.setStartupDelay(getInt(PROP_STARTUP_DELAY, DEFAULT_STARTUP_DELAY));
|
||||
String ot = _config.getProperty(I2PSnarkUtil.PROP_OPENTRACKERS);
|
||||
if (ot != null)
|
||||
_util.setOpenTrackerString(ot);
|
||||
// FIXME set util use open trackers property somehow
|
||||
getDataDir().mkdirs();
|
||||
}
|
||||
|
||||
@ -211,23 +229,24 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
public void updateConfig(String dataDir, boolean autoStart, String seedPct, String eepHost,
|
||||
public void updateConfig(String dataDir, boolean autoStart, String startDelay, String seedPct, String eepHost,
|
||||
String eepPort, String i2cpHost, String i2cpPort, String i2cpOpts,
|
||||
String upLimit, String upBW, boolean useOpenTrackers, String openTrackers) {
|
||||
boolean changed = false;
|
||||
if (eepHost != null) {
|
||||
int port = _util.getEepProxyPort();
|
||||
try { port = Integer.parseInt(eepPort); } catch (NumberFormatException nfe) {}
|
||||
String host = _util.getEepProxyHost();
|
||||
if ( (eepHost.trim().length() > 0) && (port > 0) &&
|
||||
((!host.equals(eepHost) || (port != _util.getEepProxyPort()) )) ) {
|
||||
_util.setProxy(eepHost, port);
|
||||
changed = true;
|
||||
_config.setProperty(PROP_EEP_HOST, eepHost);
|
||||
_config.setProperty(PROP_EEP_PORT, eepPort+"");
|
||||
addMessage("EepProxy location changed to " + eepHost + ":" + port);
|
||||
}
|
||||
}
|
||||
//if (eepHost != null) {
|
||||
// // unused, we use socket eepget
|
||||
// int port = _util.getEepProxyPort();
|
||||
// try { port = Integer.parseInt(eepPort); } catch (NumberFormatException nfe) {}
|
||||
// String host = _util.getEepProxyHost();
|
||||
// if ( (eepHost.trim().length() > 0) && (port > 0) &&
|
||||
// ((!host.equals(eepHost) || (port != _util.getEepProxyPort()) )) ) {
|
||||
// _util.setProxy(eepHost, port);
|
||||
// changed = true;
|
||||
// _config.setProperty(PROP_EEP_HOST, eepHost);
|
||||
// _config.setProperty(PROP_EEP_PORT, eepPort+"");
|
||||
// addMessage("EepProxy location changed to " + eepHost + ":" + port);
|
||||
// }
|
||||
//}
|
||||
if (upLimit != null) {
|
||||
int limit = _util.getMaxUploaders();
|
||||
try { limit = Integer.parseInt(upLimit); } catch (NumberFormatException nfe) {}
|
||||
@ -236,9 +255,9 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
_util.setMaxUploaders(limit);
|
||||
changed = true;
|
||||
_config.setProperty(PROP_UPLOADERS_TOTAL, "" + limit);
|
||||
addMessage("Total uploaders limit changed to " + limit);
|
||||
addMessage(_("Total uploaders limit changed to {0}", limit));
|
||||
} else {
|
||||
addMessage("Minimum total uploaders limit is " + Snark.MIN_TOTAL_UPLOADERS);
|
||||
addMessage(_("Minimum total uploaders limit is {0}", Snark.MIN_TOTAL_UPLOADERS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -250,12 +269,24 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
_util.setMaxUpBW(limit);
|
||||
changed = true;
|
||||
_config.setProperty(PROP_UPBW_MAX, "" + limit);
|
||||
addMessage("Up BW limit changed to " + limit + "KBps");
|
||||
addMessage(_("Up BW limit changed to {0}KBps", limit));
|
||||
} else {
|
||||
addMessage("Minimum Up BW limit is " + MIN_UP_BW + "KBps");
|
||||
addMessage(_("Minimum up bandwidth limit is {0}KBps", MIN_UP_BW));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (startDelay != null){
|
||||
int minutes = _util.getStartupDelay();
|
||||
try { minutes = Integer.parseInt(startDelay); } catch (NumberFormatException nfe) {}
|
||||
if ( minutes != _util.getStartupDelay()) {
|
||||
_util.setStartupDelay(minutes);
|
||||
changed = true;
|
||||
_config.setProperty(PROP_STARTUP_DELAY, "" + minutes);
|
||||
addMessage(_("Startup delay limit changed to {0} minutes", minutes));
|
||||
}
|
||||
|
||||
}
|
||||
if (i2cpHost != null) {
|
||||
int oldI2CPPort = _util.getI2CPPort();
|
||||
String oldI2CPHost = _util.getI2CPHost();
|
||||
@ -296,27 +327,30 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
}
|
||||
}
|
||||
if (snarksActive) {
|
||||
addMessage("Cannot change the I2CP settings while torrents are active");
|
||||
Properties p = new Properties();
|
||||
p.putAll(opts);
|
||||
_util.setI2CPConfig(i2cpHost, port, p);
|
||||
addMessage(_("I2CP and tunnel changes will take effect after stopping all torrents"));
|
||||
_log.debug("i2cp host [" + i2cpHost + "] i2cp port " + port + " opts [" + opts
|
||||
+ "] oldOpts [" + oldOpts + "]");
|
||||
} else {
|
||||
if (_util.connected()) {
|
||||
_util.disconnect();
|
||||
addMessage("Disconnecting old I2CP destination");
|
||||
addMessage(_("Disconnecting old I2CP destination"));
|
||||
}
|
||||
Properties p = new Properties();
|
||||
p.putAll(opts);
|
||||
addMessage("I2CP settings changed to " + i2cpHost + ":" + port + " (" + i2cpOpts.trim() + ")");
|
||||
addMessage(_("I2CP settings changed to {0}", i2cpHost + ":" + port + " (" + i2cpOpts.trim() + ")"));
|
||||
_util.setI2CPConfig(i2cpHost, port, p);
|
||||
boolean ok = _util.connect();
|
||||
if (!ok) {
|
||||
addMessage("Unable to connect with the new settings, reverting to the old I2CP settings");
|
||||
addMessage(_("Unable to connect with the new settings, reverting to the old I2CP settings"));
|
||||
_util.setI2CPConfig(oldI2CPHost, oldI2CPPort, oldOpts);
|
||||
ok = _util.connect();
|
||||
if (!ok)
|
||||
addMessage("Unable to reconnect with the old settings!");
|
||||
addMessage(_("Unable to reconnect with the old settings!"));
|
||||
} else {
|
||||
addMessage("Reconnected on the new I2CP destination");
|
||||
addMessage(_("Reconnected on the new I2CP destination"));
|
||||
_config.setProperty(PROP_I2CP_HOST, i2cpHost.trim());
|
||||
_config.setProperty(PROP_I2CP_PORT, "" + port);
|
||||
_config.setProperty(PROP_I2CP_OPTS, i2cpOpts.trim());
|
||||
@ -327,7 +361,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
Snark snark = getTorrent(name);
|
||||
if ( (snark != null) && (snark.acceptor != null) ) {
|
||||
snark.acceptor.restart();
|
||||
addMessage("I2CP listener restarted for " + snark.meta.getName());
|
||||
addMessage(_("I2CP listener restarted for \"{0}\"", snark.meta.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -337,26 +371,32 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
}
|
||||
if (shouldAutoStart() != autoStart) {
|
||||
_config.setProperty(PROP_AUTO_START, autoStart + "");
|
||||
addMessage("Adjusted autostart to " + autoStart);
|
||||
if (autoStart)
|
||||
addMessage(_("Enabled autostart"));
|
||||
else
|
||||
addMessage(_("Disabled autostart"));
|
||||
changed = true;
|
||||
}
|
||||
if (_util.shouldUseOpenTrackers() != useOpenTrackers) {
|
||||
_config.setProperty(I2PSnarkUtil.PROP_USE_OPENTRACKERS, useOpenTrackers + "");
|
||||
addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect.");
|
||||
if (useOpenTrackers)
|
||||
addMessage(_("Enabled open trackers - torrent restart required to take effect."));
|
||||
else
|
||||
addMessage(_("Disabled open trackers - torrent restart required to take effect."));
|
||||
changed = true;
|
||||
}
|
||||
if (openTrackers != null) {
|
||||
if (openTrackers.trim().length() > 0 && !openTrackers.trim().equals(_util.getOpenTrackerString())) {
|
||||
_config.setProperty(I2PSnarkUtil.PROP_OPENTRACKERS, openTrackers.trim());
|
||||
_util.setOpenTrackerString(openTrackers);
|
||||
addMessage("Open Tracker list changed - torrent restart required to take effect.");
|
||||
addMessage(_("Open Tracker list changed - torrent restart required to take effect."));
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
saveConfig();
|
||||
} else {
|
||||
addMessage("Configuration unchanged.");
|
||||
addMessage(_("Configuration unchanged."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +406,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
DataHelper.storeProps(_config, _configFile);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'.");
|
||||
addMessage(_("Unable to save the config to {0}", _configFile.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,19 +415,37 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
/** hardcoded for sanity. perhaps this should be customizable, for people who increase their ulimit, etc. */
|
||||
private static final int MAX_FILES_PER_TORRENT = 512;
|
||||
|
||||
/** set of filenames that we are dealing with */
|
||||
public Set listTorrentFiles() { synchronized (_snarks) { return new HashSet(_snarks.keySet()); } }
|
||||
/** set of canonical .torrent filenames that we are dealing with */
|
||||
public Set<String> listTorrentFiles() { synchronized (_snarks) { return new HashSet(_snarks.keySet()); } }
|
||||
|
||||
/**
|
||||
* Grab the torrent given the (canonical) filename
|
||||
* Grab the torrent given the (canonical) filename of the .torrent file
|
||||
* @return Snark or null
|
||||
*/
|
||||
public Snark getTorrent(String filename) { synchronized (_snarks) { return (Snark)_snarks.get(filename); } }
|
||||
|
||||
/**
|
||||
* Grab the torrent given the base name of the storage
|
||||
* @return Snark or null
|
||||
* @since 0.7.14
|
||||
*/
|
||||
public Snark getTorrentByBaseName(String filename) {
|
||||
synchronized (_snarks) {
|
||||
for (Snark s : _snarks.values()) {
|
||||
if (s.storage.getBaseName().equals(filename))
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addTorrent(String filename) { addTorrent(filename, false); }
|
||||
public void addTorrent(String filename, boolean dontAutoStart) {
|
||||
if ((!dontAutoStart) && !_util.connected()) {
|
||||
addMessage("Connecting to I2P");
|
||||
addMessage(_("Connecting to I2P"));
|
||||
boolean ok = _util.connect();
|
||||
if (!ok) {
|
||||
addMessage("Error connecting to I2P - check your I2CP settings!");
|
||||
addMessage(_("Error connecting to I2P - check your I2CP settings!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -396,7 +454,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
filename = sfile.getCanonicalPath();
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Unable to add the torrent " + filename, ioe);
|
||||
addMessage("ERR: Could not add the torrent '" + filename + "': " + ioe.getMessage());
|
||||
addMessage(_("Error: Could not add the torrent {0}", filename) + ": " + ioe.getMessage());
|
||||
return;
|
||||
}
|
||||
File dataDir = getDataDir();
|
||||
@ -416,10 +474,27 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(sfile);
|
||||
} catch (IOException ioe) {
|
||||
// catch this here so we don't try do delete it below
|
||||
addMessage(_("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MetaInfo info = new MetaInfo(fis);
|
||||
try {
|
||||
fis.close();
|
||||
fis = null;
|
||||
} catch (IOException e) {}
|
||||
|
||||
if (!TrackerClient.isValidAnnounce(info.getAnnounce())) {
|
||||
if (_util.shouldUseOpenTrackers() && _util.getOpenTrackers() != null) {
|
||||
addMessage(_("Warning - Ignoring non-i2p tracker in \"{0}\", will announce to i2p open trackers only", info.getName()));
|
||||
} else {
|
||||
addMessage(_("Warning - Ignoring non-i2p tracker in \"{0}\", and open trackers are disabled, you must enable open trackers before starting the torrent!", info.getName()));
|
||||
dontAutoStart = true;
|
||||
}
|
||||
}
|
||||
String rejectMessage = locked_validateTorrent(info);
|
||||
if (rejectMessage != null) {
|
||||
sfile.delete();
|
||||
@ -435,7 +510,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
}
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
addMessage("Torrent in " + sfile.getName() + " is invalid: " + ioe.getMessage());
|
||||
addMessage(_("Torrent in \"{0}\" is invalid", sfile.getName()) + ": " + ioe.getMessage());
|
||||
if (sfile.exists())
|
||||
sfile.delete();
|
||||
return;
|
||||
@ -450,9 +525,9 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
File f = new File(filename);
|
||||
if (!dontAutoStart && shouldAutoStart()) {
|
||||
torrent.startTorrent();
|
||||
addMessage("Torrent added and started: '" + f.getName() + "'.");
|
||||
addMessage(_("Torrent added and started: \"{0}\"", f.getName()));
|
||||
} else {
|
||||
addMessage("Torrent added: '" + f.getName() + "'.");
|
||||
addMessage(_("Torrent added: \"{0}\"", f.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -543,20 +618,22 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
saveConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning - does not validate announce URL - use TrackerClient.isValidAnnounce()
|
||||
*/
|
||||
private String locked_validateTorrent(MetaInfo info) throws IOException {
|
||||
String announce = info.getAnnounce();
|
||||
// basic validation of url
|
||||
if ((!announce.startsWith("http://")) ||
|
||||
(announce.indexOf(".i2p/") < 0)) // need to do better than this
|
||||
return "Non-i2p tracker in " + info.getName() + ", deleting it from our list of trackers!";
|
||||
List files = info.getFiles();
|
||||
if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) {
|
||||
return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it!";
|
||||
return _("Too many files in \"{0}\" ({1}), deleting it!", info.getName(), files.size());
|
||||
} else if ( (files == null) && (info.getName().endsWith(".torrent")) ) {
|
||||
return _("Torrent file \"{0}\" cannot end in \".torrent\", deleting it!", info.getName());
|
||||
} else if (info.getPieces() <= 0) {
|
||||
return "No pieces in " + info.getName() + "? deleting it!";
|
||||
return _("No pieces in \"{0}\", deleting it!", info.getName());
|
||||
} else if (info.getPieces() > Storage.MAX_PIECES) {
|
||||
return _("Too many pieces in \"{0}\", limit is {1}, deleting it!", info.getName(), Storage.MAX_PIECES);
|
||||
} else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) {
|
||||
return "Pieces are too large in " + info.getName() + " (" + DataHelper.formatSize(info.getPieceLength(0)) +
|
||||
"B), deleting it.";
|
||||
return _("Pieces are too large in \"{0}\" ({1}B), deleting it.", info.getName(), DataHelper.formatSize2(info.getPieceLength(0))) + ' ' +
|
||||
_("Limit is {0}B", DataHelper.formatSize2(Storage.MAX_PIECE_SIZE));
|
||||
} else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) {
|
||||
System.out.println("torrent info: " + info.toString());
|
||||
List lengths = info.getLengths();
|
||||
@ -564,8 +641,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
for (int i = 0; i < lengths.size(); i++)
|
||||
System.out.println("File " + i + " is " + lengths.get(i) + " long.");
|
||||
|
||||
return "Torrents larger than " + DataHelper.formatSize(Storage.MAX_TOTAL_SIZE) +
|
||||
"B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it!";
|
||||
return _("Torrents larger than {0}B are not supported yet, deleting \"{1}\"", Storage.MAX_TOTAL_SIZE, info.getName());
|
||||
} else {
|
||||
// ok
|
||||
return null;
|
||||
@ -581,7 +657,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
filename = sfile.getCanonicalPath();
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Unable to remove the torrent " + filename, ioe);
|
||||
addMessage("ERR: Could not remove the torrent '" + filename + "': " + ioe.getMessage());
|
||||
addMessage(_("Error: Could not remove the torrent {0}", filename) + ": " + ioe.getMessage());
|
||||
return null;
|
||||
}
|
||||
int remaining = 0;
|
||||
@ -602,7 +678,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
////_util.
|
||||
}
|
||||
if (!wasStopped)
|
||||
addMessage("Torrent stopped: '" + sfile.getName() + "'.");
|
||||
addMessage(_("Torrent stopped: \"{0}\"", sfile.getName()));
|
||||
}
|
||||
return torrent;
|
||||
}
|
||||
@ -617,7 +693,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
torrentFile.delete();
|
||||
if (torrent.storage != null)
|
||||
removeTorrentStatus(torrent.storage.getMetaInfo());
|
||||
addMessage("Torrent removed: '" + torrentFile.getName() + "'.");
|
||||
addMessage(_("Torrent removed: \"{0}\"", torrentFile.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -650,7 +726,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
public void torrentComplete(Snark snark) {
|
||||
File f = new File(snark.torrent);
|
||||
long len = snark.meta.getTotalLength();
|
||||
addMessage("Download finished: " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)");
|
||||
addMessage(_("Download finished: \"{0}\"", f.getName()) + " (" + _("size: {0}B", DataHelper.formatSize2(len)) + ')');
|
||||
updateStatus(snark);
|
||||
}
|
||||
|
||||
@ -678,7 +754,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
// already known. noop
|
||||
} else {
|
||||
if (shouldAutoStart() && !_util.connect())
|
||||
addMessage("Unable to connect to I2P!");
|
||||
addMessage(_("Unable to connect to I2P!"));
|
||||
addTorrent((String)foundNames.get(i), !shouldAutoStart());
|
||||
}
|
||||
}
|
||||
@ -694,6 +770,24 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
}
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private String _(String s) {
|
||||
return _util.getString(s);
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private String _(String s, Object o) {
|
||||
return _util.getString(s, o);
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private String _(String s, Object o, Object o2) {
|
||||
return _util.getString(s, o, o2);
|
||||
}
|
||||
|
||||
/**
|
||||
* "name", "announceURL=websiteURL" pairs
|
||||
*/
|
||||
private static final String DEFAULT_TRACKERS[] = {
|
||||
// "Postman", "http://YRgrgTLGnbTq2aZOZDJQ~o6Uk5k6TK-OZtx0St9pb0G-5EGYURZioxqYG8AQt~LgyyI~NCj6aYWpPO-150RcEvsfgXLR~CxkkZcVpgt6pns8SRc3Bi-QSAkXpJtloapRGcQfzTtwllokbdC-aMGpeDOjYLd8b5V9Im8wdCHYy7LRFxhEtGb~RL55DA8aYOgEXcTpr6RPPywbV~Qf3q5UK55el6Kex-6VCxreUnPEe4hmTAbqZNR7Fm0hpCiHKGoToRcygafpFqDw5frLXToYiqs9d4liyVB-BcOb0ihORbo0nS3CLmAwZGvdAP8BZ7cIYE3Z9IU9D1G8JCMxWarfKX1pix~6pIA-sp1gKlL1HhYhPMxwyxvuSqx34o3BqU7vdTYwWiLpGM~zU1~j9rHL7x60pVuYaXcFQDR4-QVy26b6Pt6BlAZoFmHhPcAuWfu-SFhjyZYsqzmEmHeYdAwa~HojSbofg0TMUgESRXMw6YThK1KXWeeJVeztGTz25sL8AAAA.i2p/announce.php=http://tracker.postman.i2p/"
|
||||
// , "eBook", "http://E71FRom6PZNEqTN2Lr8P-sr23b7HJVC32KoGnVQjaX6zJiXwhJy2HsXob36Qmj81TYFZdewFZa9mSJ533UZgGyQkXo2ahctg82JKYZfDe5uDxAn1E9YPjxZCWJaFJh0S~UwSs~9AZ7UcauSJIoNtpxrtbmRNVFLqnkEDdLZi26TeucfOmiFmIWnVblLniWv3tG1boE9Abd-6j3FmYVrRucYuepAILYt6katmVNOk6sXmno1Eynrp~~MBuFq0Ko6~jsc2E2CRVYXDhGHEMdt-j6JUz5D7S2RIVzDRqQyAZLKJ7OdQDmI31przzmne1vOqqqLC~1xUumZVIvF~yOeJUGNjJ1Vx0J8i2BQIusn1pQJ6UCB~ZtZZLQtEb8EPVCfpeRi2ri1M5CyOuxN0V5ekmPHrYIBNevuTCRC26NP7ZS5VDgx1~NaC3A-CzJAE6f1QXi0wMI9aywNG5KGzOPifcsih8eyGyytvgLtrZtV7ykzYpPCS-rDfITncpn5hliPUAAAA.i2p/pub/bt/announce.php=http://de-ebook-archiv.i2p/pub/bt/"
|
||||
@ -705,9 +799,8 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
// , "mastertracker", "http://VzXD~stRKbL3MOmeTn1iaCQ0CFyTmuFHiKYyo0Rd~dFPZFCYH-22rT8JD7i-C2xzYFa4jT5U2aqHzHI-Jre4HL3Ri5hFtZrLk2ax3ji7Qfb6qPnuYkuiF2E2UDmKUOppI8d9Ye7tjdhQVCy0izn55tBaB-U7UWdcvSK2i85sauyw3G0Gfads1Rvy5-CAe2paqyYATcDmGjpUNLoxbfv9KH1KmwRTNH6k1v4PyWYYnhbT39WfKMbBjSxVQRdi19cyJrULSWhjxaQfJHeWx5Z8Ev4bSPByBeQBFl2~4vqy0S5RypINsRSa3MZdbiAAyn5tr5slWR6QdoqY3qBQgBJFZppy-3iWkFqqKgSxCPundF8gdDLC5ddizl~KYcYKl42y9SGFHIukH-TZs8~em0~iahzsqWVRks3zRG~tlBcX2U3M2~OJs~C33-NKhyfZT7-XFBREvb8Szmd~p66jDxrwOnKaku-G6DyoQipJqIz4VHmY9-y5T8RrUcJcM-5lVoMpAAAA.i2p/announce.php=http://tracker.mastertracker.i2p/"
|
||||
// , "Galen", "http://5jpwQMI5FT303YwKa5Rd38PYSX04pbIKgTaKQsWbqoWjIfoancFdWCShXHLI5G5ofOb0Xu11vl2VEMyPsg1jUFYSVnu4-VfMe3y4TKTR6DTpetWrnmEK6m2UXh91J5DZJAKlgmO7UdsFlBkQfR2rY853-DfbJtQIFl91tbsmjcA5CGQi4VxMFyIkBzv-pCsuLQiZqOwWasTlnzey8GcDAPG1LDcvfflGV~6F5no9mnuisZPteZKlrv~~TDoXTj74QjByWc4EOYlwqK8sbU9aOvz~s31XzErbPTfwiawiaZ0RUI-IDrKgyvmj0neuFTWgjRGVTH8bz7cBZIc3viy6ioD-eMQOrXaQL0TCWZUelRwHRvgdPiQrxdYQs7ixkajeHzxi-Pq0EMm5Vbh3j3Q9kfUFW3JjFDA-MLB4g6XnjCbM5J1rC0oOBDCIEfhQkszru5cyLjHiZ5yeA0VThgu~c7xKHybv~OMXION7V8pBKOgET7ZgAkw1xgYe3Kkyq5syAAAA.i2p/tr/announce.php=http://galen.i2p/tr/"
|
||||
"POSTMAN", "http://tracker2.postman.i2p/announce.php=http://tracker2.postman.i2p/"
|
||||
,"WELTERDE", "http://BGKmlDOoH3RzFbPRfRpZV2FjpVj8~3moFftw5-dZfDf2070TOe8Tf2~DAVeaM6ZRLdmFEt~9wyFL8YMLMoLoiwGEH6IGW6rc45tstN68KsBDWZqkTohV1q9XFgK9JnCwE~Oi89xLBHsLMTHOabowWM6dkC8nI6QqJC2JODqLPIRfOVrDdkjLwtCrsckzLybNdFmgfoqF05UITDyczPsFVaHtpF1sRggOVmdvCM66otyonlzNcJbn59PA-R808vUrCPMGU~O9Wys0i-NoqtIbtWfOKnjCRFMNw5ex4n9m5Sxm9e20UkpKG6qzEuvKZWi8vTLe1NW~CBrj~vG7I3Ok4wybUFflBFOaBabxYJLlx4xTE1zJIVxlsekmAjckB4v-cQwulFeikR4LxPQ6mCQknW2HZ4JQIq6hL9AMabxjOlYnzh7kjOfRGkck8YgeozcyTvcDUcUsOuSTk06L4kdrv8h2Cozjbloi5zl6KTbj5ZTciKCxi73Pn9grICn-HQqEAAAA.i2p/a=http://tracker.welterde.i2p/stats?mode=top5"
|
||||
,"WELTERDE", "http://tracker.welterde.i2p/a=http://tracker.welterde.i2p/stats?mode=top5"
|
||||
, "CRSTRACK", "http://b4G9sCdtfvccMAXh~SaZrPqVQNyGQbhbYMbw6supq2XGzbjU4NcOmjFI0vxQ8w1L05twmkOvg5QERcX6Mi8NQrWnR0stLExu2LucUXg1aYjnggxIR8TIOGygZVIMV3STKH4UQXD--wz0BUrqaLxPhrm2Eh9Hwc8TdB6Na4ShQUq5Xm8D4elzNUVdpM~RtChEyJWuQvoGAHY3ppX-EJJLkiSr1t77neS4Lc-KofMVmgI9a2tSSpNAagBiNI6Ak9L1T0F9uxeDfEG9bBSQPNMOSUbAoEcNxtt7xOW~cNOAyMyGydwPMnrQ5kIYPY8Pd3XudEko970vE0D6gO19yoBMJpKx6Dh50DGgybLQ9CpRaynh2zPULTHxm8rneOGRcQo8D3mE7FQ92m54~SvfjXjD2TwAVGI~ae~n9HDxt8uxOecAAvjjJ3TD4XM63Q9TmB38RmGNzNLDBQMEmJFpqQU8YeuhnS54IVdUoVQFqui5SfDeLXlSkh4vYoMU66pvBfWbAAAA.i2p/tracker/announce.php=http://crstrack.i2p/tracker/"
|
||||
|
||||
};
|
||||
|
||||
/** comma delimited list of name=announceURL=baseURL for the trackers to be displayed */
|
||||
|
@ -57,7 +57,8 @@ public class Storage
|
||||
|
||||
/** The default piece size. */
|
||||
private static final int MIN_PIECE_SIZE = 256*1024;
|
||||
public static final int MAX_PIECE_SIZE = 1024*1024;
|
||||
/** note that we start reducing max number of peer connections above 1MB */
|
||||
public static final int MAX_PIECE_SIZE = 2*1024*1024;
|
||||
/** The maximum number of pieces in a torrent. */
|
||||
public static final int MAX_PIECES = 10*1024;
|
||||
public static final long MAX_TOTAL_SIZE = MAX_PIECE_SIZE * (long) MAX_PIECES;
|
||||
@ -285,6 +286,50 @@ public class Storage
|
||||
return needed == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file canonical path (non-directory)
|
||||
* @return number of bytes remaining; -1 if unknown file
|
||||
* @since 0.7.14
|
||||
*/
|
||||
public long remaining(String file) {
|
||||
long bytes = 0;
|
||||
for (int i = 0; i < rafs.length; i++) {
|
||||
File f = RAFfile[i];
|
||||
// use canonical in case snark dir or sub dirs are symlinked
|
||||
String canonical = null;
|
||||
if (f != null) {
|
||||
try {
|
||||
canonical = f.getCanonicalPath();
|
||||
} catch (IOException ioe) {
|
||||
f = null;
|
||||
}
|
||||
}
|
||||
if (f != null && canonical.equals(file)) {
|
||||
if (complete())
|
||||
return 0;
|
||||
int psz = metainfo.getPieceLength(0);
|
||||
long start = bytes;
|
||||
long end = start + lengths[i];
|
||||
int pc = (int) (bytes / psz);
|
||||
long rv = 0;
|
||||
if (!bitfield.get(pc))
|
||||
rv = Math.min(psz - (start % psz), lengths[i]);
|
||||
int pieces = metainfo.getPieces();
|
||||
for (int j = pc + 1; (((long)j) * psz) < end && j < pieces; j++) {
|
||||
if (!bitfield.get(j)) {
|
||||
if (((long)(j+1))*psz < end)
|
||||
rv += psz;
|
||||
else
|
||||
rv += end - (((long)j) * psz);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
bytes += lengths[i];
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The BitField that tells which pieces this storage contains.
|
||||
* Do not change this since this is the current state of the storage.
|
||||
@ -294,6 +339,18 @@ public class Storage
|
||||
return bitfield;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base file or directory name of the data,
|
||||
* as specified in the .torrent file, but filtered to remove
|
||||
* illegal characters. This is where the data actually is,
|
||||
* relative to the snark base dir.
|
||||
*
|
||||
* @since 0.7.14
|
||||
*/
|
||||
public String getBaseName() {
|
||||
return filterName(metainfo.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates (and/or checks) all files from the metainfo file list.
|
||||
*/
|
||||
@ -419,13 +476,29 @@ public class Storage
|
||||
}
|
||||
}
|
||||
|
||||
private static final char[] ILLEGAL = new char[] {
|
||||
'<', '>', ':', '"', '/', '\\', '|', '?', '*',
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
|
||||
|
||||
/**
|
||||
* Removes 'suspicious' characters from the give file name.
|
||||
* Removes 'suspicious' characters from the given file name.
|
||||
* http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
|
||||
*/
|
||||
private static String filterName(String name)
|
||||
{
|
||||
// XXX - Is this enough?
|
||||
return name.replace(File.separatorChar, '_');
|
||||
if (name.equals(".") || name.equals(" "))
|
||||
return "_";
|
||||
String rv = name;
|
||||
if (rv.startsWith("."))
|
||||
rv = '_' + rv.substring(1);
|
||||
if (rv.endsWith(".") || rv.endsWith(" "))
|
||||
rv = rv.substring(0, rv.length() - 1) + '_';
|
||||
for (int i = 0; i < ILLEGAL.length; i++) {
|
||||
if (rv.indexOf(ILLEGAL[i]) >= 0)
|
||||
rv = rv.replace(ILLEGAL[i], '_');
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private File createFileFromNames(File base, List names) throws IOException
|
||||
@ -576,6 +649,9 @@ public class Storage
|
||||
if (rafs == null) return;
|
||||
for (int i = 0; i < rafs.length; i++)
|
||||
{
|
||||
// if we had an IOE in check(), the RAFlock may be null
|
||||
if (RAFlock[i] == null)
|
||||
continue;
|
||||
try {
|
||||
synchronized(RAFlock[i]) {
|
||||
closeRAF(i);
|
||||
|
@ -24,6 +24,8 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
@ -31,6 +33,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@ -42,7 +45,7 @@ import net.i2p.util.Log;
|
||||
*/
|
||||
public class TrackerClient extends I2PAppThread
|
||||
{
|
||||
private static final Log _log = new Log(TrackerClient.class);
|
||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(TrackerClient.class);
|
||||
private static final String NO_EVENT = "";
|
||||
private static final String STARTED_EVENT = "started";
|
||||
private static final String COMPLETED_EVENT = "completed";
|
||||
@ -123,13 +126,19 @@ public class TrackerClient extends I2PAppThread
|
||||
// followed by the secondary open trackers
|
||||
// It's painful, but try to make sure if an open tracker is also
|
||||
// the primary tracker, that we don't add it twice.
|
||||
// todo: check for b32 matches as well
|
||||
trackers = new ArrayList(2);
|
||||
String primary = meta.getAnnounce();
|
||||
if (isValidAnnounce(primary)) {
|
||||
trackers.add(new Tracker(meta.getAnnounce(), true));
|
||||
} else {
|
||||
_log.warn("Skipping invalid or non-i2p announce: " + primary);
|
||||
}
|
||||
List tlist = _util.getOpenTrackers();
|
||||
if (tlist != null) {
|
||||
for (int i = 0; i < tlist.size(); i++) {
|
||||
String url = (String)tlist.get(i);
|
||||
if (!url.startsWith("http://")) {
|
||||
if (!isValidAnnounce(url)) {
|
||||
_log.error("Bad announce URL: [" + url + "]");
|
||||
continue;
|
||||
}
|
||||
@ -138,22 +147,29 @@ public class TrackerClient extends I2PAppThread
|
||||
_log.error("Bad announce URL: [" + url + "]");
|
||||
continue;
|
||||
}
|
||||
if (meta.getAnnounce().startsWith(url.substring(0, slash)))
|
||||
if (primary.startsWith(url.substring(0, slash)))
|
||||
continue;
|
||||
String dest = _util.lookup(url.substring(7, slash));
|
||||
if (dest == null) {
|
||||
_log.error("Announce host unknown: [" + url + "]");
|
||||
_log.error("Announce host unknown: [" + url.substring(7, slash) + "]");
|
||||
continue;
|
||||
}
|
||||
if (meta.getAnnounce().startsWith("http://" + dest))
|
||||
if (primary.startsWith("http://" + dest))
|
||||
continue;
|
||||
if (meta.getAnnounce().startsWith("http://i2p/" + dest))
|
||||
if (primary.startsWith("http://i2p/" + dest))
|
||||
continue;
|
||||
trackers.add(new Tracker(url, false));
|
||||
_log.debug("Additional announce: [" + url + "] for infoHash: " + infoHash);
|
||||
}
|
||||
}
|
||||
|
||||
if (tlist.isEmpty()) {
|
||||
// FIXME really need to get this message to the gui
|
||||
stop = true;
|
||||
_log.error("No valid trackers for infoHash: " + infoHash);
|
||||
return;
|
||||
}
|
||||
|
||||
long uploaded = coordinator.getUploaded();
|
||||
long downloaded = coordinator.getDownloaded();
|
||||
long left = coordinator.getLeft();
|
||||
@ -167,7 +183,7 @@ public class TrackerClient extends I2PAppThread
|
||||
boolean runStarted = false;
|
||||
boolean firstTime = true;
|
||||
int consecutiveFails = 0;
|
||||
Random r = new Random();
|
||||
Random r = I2PAppContext.getGlobalContext().random();
|
||||
while(!stop)
|
||||
{
|
||||
try
|
||||
@ -243,7 +259,7 @@ public class TrackerClient extends I2PAppThread
|
||||
tr.started = true;
|
||||
|
||||
Set peers = info.getPeers();
|
||||
tr.seenPeers = peers.size();
|
||||
tr.seenPeers = info.getPeerCount();
|
||||
if (coordinator.trackerSeenPeers < tr.seenPeers) // update rising number quickly
|
||||
coordinator.trackerSeenPeers = tr.seenPeers;
|
||||
if ( (left > 0) && (!completed) ) {
|
||||
@ -254,6 +270,7 @@ public class TrackerClient extends I2PAppThread
|
||||
Iterator it = ordered.iterator();
|
||||
while (it.hasNext()) {
|
||||
Peer cur = (Peer)it.next();
|
||||
// FIXME if id == us || dest == us continue;
|
||||
// only delay if we actually make an attempt to add peer
|
||||
if(coordinator.addPeer(cur)) {
|
||||
int delay = DELAY_MUL;
|
||||
@ -315,7 +332,7 @@ public class TrackerClient extends I2PAppThread
|
||||
// try to contact everybody we can
|
||||
// Don't try to restart I2CP connection just to say goodbye
|
||||
for (Iterator iter = trackers.iterator(); iter.hasNext(); ) {
|
||||
if (!verifyConnected()) return;
|
||||
if (!_util.connected()) return;
|
||||
Tracker tr = (Tracker)iter.next();
|
||||
if (tr.started && (!tr.stop) && tr.trackerProblems == null)
|
||||
doRequest(tr, infoHash, peerID, uploaded,
|
||||
@ -341,6 +358,10 @@ public class TrackerClient extends I2PAppThread
|
||||
+ "&downloaded=" + downloaded
|
||||
+ "&left=" + left
|
||||
+ ((! event.equals(NO_EVENT)) ? ("&event=" + event) : "");
|
||||
if (left <= 0 || event.equals(STOPPED_EVENT) || !coordinator.needPeers())
|
||||
s += "&numwant=0";
|
||||
else
|
||||
s += "&numwant=" + _util.getMaxConnections();
|
||||
_util.debug("Sending TrackerClient request: " + s, Snark.INFO);
|
||||
|
||||
tr.lastRequestTime = System.currentTimeMillis();
|
||||
@ -370,8 +391,13 @@ public class TrackerClient extends I2PAppThread
|
||||
}
|
||||
|
||||
/**
|
||||
* Very lazy byte[] to URL encoder. Just encodes everything, even
|
||||
* "normal" chars.
|
||||
* Very lazy byte[] to URL encoder. Just encodes almost everything, even
|
||||
* some "normal" chars.
|
||||
* By not encoding about 1/4 of the chars, we make random data like hashes about 16% smaller.
|
||||
*
|
||||
* RFC1738: 0-9a-zA-Z$-_.+!*'(),
|
||||
* Us: 0-9a-zA-Z
|
||||
*
|
||||
*/
|
||||
public static String urlencode(byte[] bs)
|
||||
{
|
||||
@ -379,16 +405,38 @@ public class TrackerClient extends I2PAppThread
|
||||
for (int i = 0; i < bs.length; i++)
|
||||
{
|
||||
int c = bs[i] & 0xFF;
|
||||
if ((c >= '0' && c <= '9') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
(c >= 'a' && c <= 'z')) {
|
||||
sb.append((char)c);
|
||||
} else {
|
||||
sb.append('%');
|
||||
if (c < 16)
|
||||
sb.append('0');
|
||||
sb.append(Integer.toHexString(c));
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private class Tracker
|
||||
/**
|
||||
* @return true for i2p hosts only
|
||||
* @since 0.7.12
|
||||
*/
|
||||
static boolean isValidAnnounce(String ann) {
|
||||
URL url;
|
||||
try {
|
||||
url = new URL(ann);
|
||||
} catch (MalformedURLException mue) {
|
||||
return false;
|
||||
}
|
||||
return url.getProtocol().equals("http") &&
|
||||
(url.getHost().endsWith(".i2p") || url.getHost().equals("i2p")) &&
|
||||
url.getPort() < 0;
|
||||
}
|
||||
|
||||
private static class Tracker
|
||||
{
|
||||
String announce;
|
||||
boolean isPrimary;
|
||||
|
@ -23,6 +23,7 @@ package org.klomp.snark;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -37,6 +38,8 @@ public class TrackerInfo
|
||||
private final String failure_reason;
|
||||
private final int interval;
|
||||
private final Set peers;
|
||||
private int complete;
|
||||
private int incomplete;
|
||||
|
||||
public TrackerInfo(InputStream in, byte[] my_id, MetaInfo metainfo)
|
||||
throws IOException
|
||||
@ -68,11 +71,26 @@ public class TrackerInfo
|
||||
throw new InvalidBEncodingException("No interval given");
|
||||
else
|
||||
interval = beInterval.getInt();
|
||||
|
||||
BEValue bePeers = (BEValue)m.get("peers");
|
||||
if (bePeers == null)
|
||||
throw new InvalidBEncodingException("No peer list");
|
||||
peers = Collections.EMPTY_SET;
|
||||
else
|
||||
peers = getPeers(bePeers.getList(), my_id, metainfo);
|
||||
|
||||
BEValue bev = (BEValue)m.get("complete");
|
||||
if (bev != null) try {
|
||||
complete = bev.getInt();
|
||||
if (complete < 0)
|
||||
complete = 0;
|
||||
} catch (InvalidBEncodingException ibe) {}
|
||||
|
||||
bev = (BEValue)m.get("incomplete");
|
||||
if (bev != null) try {
|
||||
incomplete = bev.getInt();
|
||||
if (incomplete < 0)
|
||||
incomplete = 0;
|
||||
} catch (InvalidBEncodingException ibe) {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,6 +133,12 @@ public class TrackerInfo
|
||||
return peers;
|
||||
}
|
||||
|
||||
public int getPeerCount()
|
||||
{
|
||||
int pc = peers == null ? 0 : peers.size();
|
||||
return Math.max(pc, complete + incomplete - 1);
|
||||
}
|
||||
|
||||
public String getFailureReason()
|
||||
{
|
||||
return failure_reason;
|
||||
@ -132,6 +156,8 @@ public class TrackerInfo
|
||||
return "TrackerInfo[FAILED: " + failure_reason + "]";
|
||||
else
|
||||
return "TrackerInfo[interval=" + interval
|
||||
+ (complete > 0 ? (", complete=" + complete) : "" )
|
||||
+ (incomplete > 0 ? (", incomplete=" + incomplete) : "" )
|
||||
+ ", peers=" + peers + "]";
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,9 @@ public class BDecoder
|
||||
public BEValue bdecodeMap() throws IOException
|
||||
{
|
||||
int c = getNextIndicator();
|
||||
if (c != 'd')
|
||||
if (c == '<')
|
||||
throw new InvalidBEncodingException("Expected a .torrent metainfo file but found HTML? Check URL or file!");
|
||||
else if (c != 'd')
|
||||
throw new InvalidBEncodingException("Expected 'd', not '"
|
||||
+ (char)c + "'");
|
||||
indicator = 0;
|
||||
|
@ -179,7 +179,7 @@ public class BEValue
|
||||
if (value instanceof byte[])
|
||||
{
|
||||
byte[] bs = (byte[])value;
|
||||
// XXX - Stupid heuristic...
|
||||
// XXX - Stupid heuristic... and not UTF-8
|
||||
if (bs.length <= 12)
|
||||
valueString = new String(bs);
|
||||
else
|
||||
|
@ -58,6 +58,23 @@
|
||||
<Arg>webapps/i2psnark.war</Arg>
|
||||
</Call>
|
||||
|
||||
<!-- this is so we can find the css -->
|
||||
<Call name="addContext">
|
||||
<Arg>
|
||||
<New class="org.mortbay.http.HttpContext">
|
||||
<Set name="contextPath">/themes</Set>
|
||||
<Set name="resourceBase">./docs/themes</Set>
|
||||
<Call name="addHandler">
|
||||
<Arg>
|
||||
<New class="org.mortbay.http.handler.ResourceHandler">
|
||||
<Set name="redirectWelcome">FALSE</Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- Configure the Other Server Options -->
|
||||
<!-- =============================================================== -->
|
||||
|
783
apps/i2psnark/locale/messages_de.po
Normal file
@ -0,0 +1,783 @@
|
||||
# I2P
|
||||
# Copyright (C) 2009 The I2P Project
|
||||
# This file is distributed under the same license as the i2psnark package.
|
||||
# To contribute translations, see http://www.i2p2.de/newdevelopers
|
||||
# foo <foo@bar>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P i2psnark\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-07-08 08:03+0000\n"
|
||||
"PO-Revision-Date: 2010-07-08 10:15+0100\n"
|
||||
"Last-Translator: echelon <echelon@i2pmail.org>\n"
|
||||
"Language-Team: foo <foo@bar>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Language: German\n"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:88
|
||||
#, java-format
|
||||
msgid "Adding torrents in {0} minutes"
|
||||
msgstr "Füge Torrents in {0} Minuten hinzu"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:258
|
||||
#, java-format
|
||||
msgid "Total uploaders limit changed to {0}"
|
||||
msgstr "Totale Anzahl an Uploadslots geändert auf {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:260
|
||||
#, java-format
|
||||
msgid "Minimum total uploaders limit is {0}"
|
||||
msgstr "Minimale Anzahl and Uploadslots ist {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:272
|
||||
#, java-format
|
||||
msgid "Up BW limit changed to {0}KBps"
|
||||
msgstr "Upload Bandbreite wurde geändert auf {0}kbyte/s"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:274
|
||||
#, java-format
|
||||
msgid "Minimum up bandwidth limit is {0}KBps"
|
||||
msgstr "Minimales upload Bandbreiten Limit ist {0} kbyte/s"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:286
|
||||
#, java-format
|
||||
msgid "Startup delay limit changed to {0} minutes"
|
||||
msgstr "Startverzögerung geändert auf {0} Minuten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:333
|
||||
msgid "I2CP and tunnel changes will take effect after stopping all torrents"
|
||||
msgstr "Änderungen an I2CP und am Tunnel werden nach dem Stoppen aller Torrents wirksam"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:339
|
||||
msgid "Disconnecting old I2CP destination"
|
||||
msgstr "Trenne das alte I2CP Ziel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:343
|
||||
#, java-format
|
||||
msgid "I2CP settings changed to {0}"
|
||||
msgstr "I2CP Einstellungen geändert auf {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:347
|
||||
msgid "Unable to connect with the new settings, reverting to the old I2CP settings"
|
||||
msgstr "Konnte nicht mit den neuen Einstellungen verbinden, benutze wieder die alten I2CP Einstellungen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:351
|
||||
msgid "Unable to reconnect with the old settings!"
|
||||
msgstr "Konnte nicht mit den alten Einstellungen verbinden!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:353
|
||||
msgid "Reconnected on the new I2CP destination"
|
||||
msgstr "Verbunden auf dem neuem I2CP Ziel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:364
|
||||
#, java-format
|
||||
msgid "I2CP listener restarted for \"{0}\""
|
||||
msgstr "I2CP Verbindung neu gestartet für \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:375
|
||||
msgid "Enabled autostart"
|
||||
msgstr "Aktiviere Autostart"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:377
|
||||
msgid "Disabled autostart"
|
||||
msgstr "Deaktiviere Autostart"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:383
|
||||
msgid "Enabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Open Tracker aktiviert - zum aktiv werden müssen die Torrents neu gestartet werden"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:385
|
||||
msgid "Disabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Open Tracker deaktiviert - zum aktiv werden müssen die Torrents neu gestartet werden"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:392
|
||||
msgid "Open Tracker list changed - torrent restart required to take effect."
|
||||
msgstr "Open Tracker Liste geändert - zum aktiv werden müssen die Torrents neu gestartet werden"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:399
|
||||
msgid "Configuration unchanged."
|
||||
msgstr "Konfiguration nicht geändert."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:409
|
||||
#, java-format
|
||||
msgid "Unable to save the config to {0}"
|
||||
msgstr "Konnte Konfiguration nicht nach {0} sichern"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:445
|
||||
msgid "Connecting to I2P"
|
||||
msgstr "Verbinde mit I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:448
|
||||
msgid "Error connecting to I2P - check your I2CP settings!"
|
||||
msgstr "Fehler beim Verbinden mit I2P - Kontrollieren Sie die I2CP EInstellungen!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:457
|
||||
#, java-format
|
||||
msgid "Error: Could not add the torrent {0}"
|
||||
msgstr "Fehler: Konnte den Torrent nicht hinzufügen {0}"
|
||||
|
||||
#. catch this here so we don't try do delete it below
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:479
|
||||
#, java-format
|
||||
msgid "Cannot open \"{0}\""
|
||||
msgstr "Kann folgendes nicht öffnen: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:492
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", will announce to i2p open trackers only"
|
||||
msgstr "Warnung - ignoriere nicht-I2P Tracker in \"{0}\", publiziere nur zu I2P Open Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:494
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", and open trackers are disabled, you must enable open trackers before starting the torrent!"
|
||||
msgstr "Warnung - Ignoriere nicht-I2P Tracker in \"{0}\" und Open Tracker sind deaktiviert, Sie müssen Open Tracker aktivieren bevor sie den Torrent starten!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:513
|
||||
#, java-format
|
||||
msgid "Torrent in \"{0}\" is invalid"
|
||||
msgstr "Torrent in \"{0}\" ist nicht gültig"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:528
|
||||
#, java-format
|
||||
msgid "Torrent added and started: \"{0}\""
|
||||
msgstr "Torrent hinzugefügt und gestartet: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:530
|
||||
#, java-format
|
||||
msgid "Torrent added: \"{0}\""
|
||||
msgstr "Torrent hinzugefügt: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:627
|
||||
#, java-format
|
||||
msgid "Too many files in \"{0}\" ({1}), deleting it!"
|
||||
msgstr "Zu viele Dateien in \"{0}\" ({1}), lösche es! "
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:629
|
||||
#, java-format
|
||||
msgid "Torrent file \"{0}\" cannot end in \".torrent\", deleting it!"
|
||||
msgstr "Torrent Datei \"{0}\" darf nicht mit '.torrent' enden, lösche es!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:631
|
||||
#, java-format
|
||||
msgid "No pieces in \"{0}\", deleting it!"
|
||||
msgstr "Keine Teile in \"{0}\", entferne es!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:633
|
||||
#, java-format
|
||||
msgid "Too many pieces in \"{0}\", limit is {1}, deleting it!"
|
||||
msgstr "Zu viele Teile in \"{0}\" , das Limit sind {1}, lösche es!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:635
|
||||
#, java-format
|
||||
msgid "Pieces are too large in \"{0}\" ({1}B), deleting it."
|
||||
msgstr "Teile sind zu Groß in \"{0}\" ({1}B), lösche es."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:636
|
||||
#, java-format
|
||||
msgid "Limit is {0}B"
|
||||
msgstr "Limit ist \"{0}\"Byte"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:644
|
||||
#, java-format
|
||||
msgid "Torrents larger than {0}B are not supported yet, deleting \"{1}\""
|
||||
msgstr "Torrents größer als \"{0}\"Bytes werden nicht unterstützt, lösche \"{1}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:660
|
||||
#, java-format
|
||||
msgid "Error: Could not remove the torrent {0}"
|
||||
msgstr "Fehler: konnte den torrent \"{0}\" nicht entfernen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:681
|
||||
#, java-format
|
||||
msgid "Torrent stopped: \"{0}\""
|
||||
msgstr "Torrent angehalten:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:696
|
||||
#, java-format
|
||||
msgid "Torrent removed: \"{0}\""
|
||||
msgstr "Torrent entfernt:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "Download finished: \"{0}\""
|
||||
msgstr "Download beendet:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "size: {0}B"
|
||||
msgstr "Größe: {0}Byte"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:757
|
||||
msgid "Unable to connect to I2P!"
|
||||
msgstr "Konnte nicht mit I2P verbinden!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:174
|
||||
msgid "I2PSnark - Anonymous BitTorrent Client"
|
||||
msgstr "I2PSnark - Anonymer BitTorrent Klient"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:185
|
||||
msgid "Torrents"
|
||||
msgstr "Torrents"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:187
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:193
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:837
|
||||
msgid "I2PSnark"
|
||||
msgstr "I2PSnark"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:191
|
||||
msgid "Refresh page"
|
||||
msgstr "Aktualisiere Seite"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:195
|
||||
msgid "Forum"
|
||||
msgstr "Forum"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:240
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1289
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:246
|
||||
msgid "Hide Peers"
|
||||
msgstr "Verstecke Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:249
|
||||
msgid "Show Peers"
|
||||
msgstr "Zeige Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:254
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1271
|
||||
msgid "Torrent"
|
||||
msgstr "Torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:256
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:258
|
||||
msgid "Downloaded"
|
||||
msgstr "Heruntergeladen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:260
|
||||
msgid "Uploaded"
|
||||
msgstr "Hochgeladen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:262
|
||||
msgid "Down Rate"
|
||||
msgstr "Down Rate"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:264
|
||||
msgid "Up Rate"
|
||||
msgstr "Up Rate"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:271
|
||||
msgid "Stop all torrents and the I2P tunnel"
|
||||
msgstr "Stoppe alle Torrents und den I2P Tunnel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:273
|
||||
msgid "Stop All"
|
||||
msgstr "Stoppe alle"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:278
|
||||
msgid "Start all torrents and the I2P tunnel"
|
||||
msgstr "Starte alle Torrents und den I2P Tunnel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:280
|
||||
msgid "Start All"
|
||||
msgstr "Starte alle"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:297
|
||||
msgid "No torrents loaded."
|
||||
msgstr "Keine Torrents geladen."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:302
|
||||
msgid "Totals"
|
||||
msgstr "Total"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:304
|
||||
#, java-format
|
||||
msgid "1 torrent"
|
||||
msgid_plural "{0} torrents"
|
||||
msgstr[0] "1 Torrent"
|
||||
msgstr[1] "{0} Torrents"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:307
|
||||
#, java-format
|
||||
msgid "1 connected peer"
|
||||
msgid_plural "{0} connected peers"
|
||||
msgstr[0] "1 verbundener Teilnehmer"
|
||||
msgstr[1] "{0} verbundene Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:336
|
||||
#, java-format
|
||||
msgid "Torrent file {0} does not exist"
|
||||
msgstr "Torrent Datei {0} existiert nicht"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:346
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1476
|
||||
#, java-format
|
||||
msgid "Torrent already running: {0}"
|
||||
msgstr "Torrent rennt schon: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:348
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1478
|
||||
#, java-format
|
||||
msgid "Torrent already in the queue: {0}"
|
||||
msgstr "Torrent ist schon in der Queue: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:352
|
||||
#, java-format
|
||||
msgid "Copying torrent to {0}"
|
||||
msgstr "Kopiere Torrent nach {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "Unable to copy the torrent to {0}"
|
||||
msgstr "Konnte den Torrent nicht nach {0} kopieren"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "from {0}"
|
||||
msgstr "von {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:363
|
||||
#, java-format
|
||||
msgid "Fetching {0}"
|
||||
msgstr "Hole {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:367
|
||||
msgid "Invalid URL - must start with http://"
|
||||
msgstr "Ungültige URL - muß mit http:// anfangen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:397
|
||||
#, java-format
|
||||
msgid "Starting up torrent {0}"
|
||||
msgstr "Starte Torrent {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:417
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:435
|
||||
#, java-format
|
||||
msgid "Torrent file deleted: {0}"
|
||||
msgstr "Torrent Datei gelöscht: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:441
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:451
|
||||
#, java-format
|
||||
msgid "Data file deleted: {0}"
|
||||
msgstr "Daten Datei gelöscht: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:443
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:453
|
||||
#, java-format
|
||||
msgid "Data file could not be deleted: {0}"
|
||||
msgstr "Datendatei konnte nicht gelöscht werden: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:462
|
||||
#, java-format
|
||||
msgid "Data dir deleted: {0}"
|
||||
msgstr "Datenverzeichnis wurde gelöscht: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:494
|
||||
msgid "Error creating torrent - you must select a tracker"
|
||||
msgstr "Fehler beim Erstellen des Torrent - Sie müssen einen Tracker auswählen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:509
|
||||
#, java-format
|
||||
msgid "Torrent created for \"{0}\""
|
||||
msgstr "Torrent erstellt für \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:512
|
||||
#, java-format
|
||||
msgid "Many I2P trackers require you to register new torrents before seeding - please do so before starting \"{0}\""
|
||||
msgstr "Viele I2P Tracker erfordern eine Registrierung bevor der Torrent verteilt wird - bitte machen Sie dieses vor dem Start von \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:514
|
||||
#, java-format
|
||||
msgid "Error creating a torrent for \"{0}\""
|
||||
msgstr "Fehler beim Erstellen eines Torrent für \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:517
|
||||
#, java-format
|
||||
msgid "Cannot create a torrent for the nonexistent data: {0}"
|
||||
msgstr "Kann keinen Torrent für nicht existierende Daten erstellen: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:520
|
||||
msgid "Error creating torrent - you must enter a file or directory"
|
||||
msgstr "Fehler beim Erstellen des Torrent - Sie müssen eine Datei oder Verzeichnis angeben."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:523
|
||||
msgid "Stopping all torrents and closing the I2P tunnel."
|
||||
msgstr "Stoppt alle Torrents und beendet den I2P Tunnel."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:532
|
||||
msgid "I2P tunnel closed."
|
||||
msgstr "I2P Tunnel geschlossen."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:535
|
||||
msgid "Opening the I2P tunnel and starting all torrents."
|
||||
msgstr "Öffnet den I2P Tunnel und startet alle Torrents."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:657
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:851
|
||||
msgid "Unknown"
|
||||
msgstr "Unbekannt"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:660
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:665
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:670
|
||||
msgid "TrackerErr"
|
||||
msgstr "TrackerFehler"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:663
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:666
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:677
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:680
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:688
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:691
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:696
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:699
|
||||
#, java-format
|
||||
msgid "1 peer"
|
||||
msgid_plural "{0} peers"
|
||||
msgstr[0] "1 Teilnehmer"
|
||||
msgstr[1] "{0} Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:674
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:679
|
||||
msgid "Seeding"
|
||||
msgstr "Verteile"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:682
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1327
|
||||
msgid "Complete"
|
||||
msgstr "Komplett"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:685
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:690
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:693
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:698
|
||||
msgid "Stalled"
|
||||
msgstr "Gedrosselt"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:701
|
||||
msgid "No Peers"
|
||||
msgstr "Keine Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:703
|
||||
msgid "Stopped"
|
||||
msgstr "Gestoppt"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:718
|
||||
msgid "View files"
|
||||
msgstr "Betrachte Dateien"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:720
|
||||
msgid "Open file"
|
||||
msgstr "Öffne Datei"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:750
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:967
|
||||
msgid "Tracker"
|
||||
msgstr "Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:751
|
||||
msgid "Details"
|
||||
msgstr "Details"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:785
|
||||
msgid "Stop the torrent"
|
||||
msgstr "Stoppe den Torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:787
|
||||
msgid "Stop"
|
||||
msgstr "Stop"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:793
|
||||
msgid "Start the torrent"
|
||||
msgstr "Starte den Torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:795
|
||||
msgid "Start"
|
||||
msgstr "Start"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:800
|
||||
msgid "Remove the torrent from the active list, deleting the .torrent file"
|
||||
msgstr "Entfernt den Torrent von der aktiven Liste und löscht die .torrent Datei"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:805
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the file \\''{0}.torrent\\'' (downloaded data will not be deleted) ?"
|
||||
msgstr "Sind Sie sicher, das Sie die Datei \\''{0}.torrent\\'' löschen wollen (heruntergeladene Daten werden nicht gelöscht)?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:807
|
||||
msgid "Remove"
|
||||
msgstr "Entfernen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:811
|
||||
msgid "Delete the .torrent file and the associated data file(s)"
|
||||
msgstr "Löscht die .torrent Datei und dazugehörigen Daten Datei(en)"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:816
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded data?"
|
||||
msgstr "Sind Sie sicher, das die die Torrentdatei \\''{0}\\'' und alle heruntergeladene Daten löschen wollen?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:818
|
||||
msgid "Delete"
|
||||
msgstr "Löschen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:861
|
||||
msgid "Seed"
|
||||
msgstr "Quelle"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:879
|
||||
msgid "Uninteresting (The peer has no pieces we need)"
|
||||
msgstr "Uninteressiert (Der Teilnehmer hat keine Teile die wir benötigen)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:881
|
||||
msgid "Choked (The peer is not allowing us to request pieces)"
|
||||
msgstr "Gedrosselt (der Teilnehmer hat uns nicht erlaubt Teile anzufordern)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:895
|
||||
msgid "Uninterested (We have no pieces the peer needs)"
|
||||
msgstr "Uninteressiert (Wir haben keine Teile die der Teilnehmer benötigt)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:897
|
||||
msgid "Choking (We are not allowing the peer to request pieces)"
|
||||
msgstr "Gedrosselt (Wir erlauben dem Teilnehmer nicht Teile anzufordern)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:927
|
||||
msgid "Add Torrent"
|
||||
msgstr "Füge Torrent hinzu"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:929
|
||||
msgid "From URL"
|
||||
msgstr "Quell URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:934
|
||||
msgid "Add torrent"
|
||||
msgstr "Füge Torrent hinzu"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:937
|
||||
#, java-format
|
||||
msgid "Alternately, you can copy .torrent files to the directory {0}."
|
||||
msgstr "Alternativ können Sie die .torrent Dateien auch nach {0} kopieren."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:939
|
||||
msgid "Removing a .torrent file will cause the torrent to stop."
|
||||
msgstr "Entfernen der .torrent Datei stoppt einen Torrent."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:958
|
||||
msgid "Create Torrent"
|
||||
msgstr "Erstelle einen Torrent"
|
||||
|
||||
#. out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n");
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:961
|
||||
msgid "Data to seed"
|
||||
msgstr "Daten zum Verteilen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:965
|
||||
msgid "File or directory to seed (must be within the specified path)"
|
||||
msgstr "Datei oder Verzeichnis zum Verteilen (muß im angegebenen Pfad sein)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:969
|
||||
msgid "Select a tracker"
|
||||
msgstr "Wähle einen Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:982
|
||||
msgid "or"
|
||||
msgstr "oder"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:985
|
||||
msgid "Specify custom tracker announce URL"
|
||||
msgstr "Geben Sie eine Tracker Announce URL an"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:988
|
||||
msgid "Create torrent"
|
||||
msgstr "Erstelle Torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1006
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1133
|
||||
msgid "Configuration"
|
||||
msgstr "Einstellungen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1009
|
||||
msgid "Data directory"
|
||||
msgstr "Daten Verzeichnis"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1012
|
||||
msgid "Directory to store torrents and data"
|
||||
msgstr "Verzeichnis zum speichern von Torrent Dateien und Daten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1014
|
||||
msgid "Edit i2psnark.config and restart to change"
|
||||
msgstr "Editiere i2psnark.config zum ändern und starte neu."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1018
|
||||
msgid "Auto start"
|
||||
msgstr "Auto Start"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1022
|
||||
msgid "If checked, automatically start torrents that are added"
|
||||
msgstr "Wenn markiert werden hinzugefügte Torrents automatisch gestartet."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1026
|
||||
msgid "Startup delay"
|
||||
msgstr "Startverzögerung"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1028
|
||||
msgid "minutes"
|
||||
msgstr "Minuten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1052
|
||||
msgid "Total uploader limit"
|
||||
msgstr "Totales Uploader Limit."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1055
|
||||
msgid "peers"
|
||||
msgstr "Teilnehmer"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1059
|
||||
msgid "Up bandwidth limit"
|
||||
msgstr "Upload Bandbreiten Limit."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1062
|
||||
msgid "Half available bandwidth recommended."
|
||||
msgstr "Halbe verfügbare Bandbreite ist empfohlen."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1064
|
||||
msgid "View or change router bandwidth"
|
||||
msgstr "Router Bandbreite ansehen oder ändern"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1068
|
||||
msgid "Use open trackers also"
|
||||
msgstr "Benutze auch Open Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1072
|
||||
msgid "If checked, announce torrents to open trackers as well as the tracker listed in the torrent file"
|
||||
msgstr "Wenn markiert wird der Torrent neben dem angegebenen Tracker auch bei den Open Trackers bekannt gegeben."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1076
|
||||
msgid "Open tracker announce URLs"
|
||||
msgstr "Open Tracker Announce URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1088
|
||||
msgid "Inbound Settings"
|
||||
msgstr "Eingangseinstellungen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1094
|
||||
msgid "Outbound Settings"
|
||||
msgstr "Ausgangseinstellungen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1101
|
||||
msgid "I2CP host"
|
||||
msgstr "I2CP Host"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1106
|
||||
msgid "I2CP port"
|
||||
msgstr "I2CP Port"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1118
|
||||
msgid "I2CP options"
|
||||
msgstr "I2CP Optionen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1124
|
||||
msgid "Save configuration"
|
||||
msgstr "Speichere Einstellungen"
|
||||
|
||||
#. * dummies for translation
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1141
|
||||
#, java-format
|
||||
msgid "1 hop"
|
||||
msgid_plural "{0} hops"
|
||||
msgstr[0] "1 Zwischenstation"
|
||||
msgstr[1] "{0} Zwischenstationen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1142
|
||||
#, java-format
|
||||
msgid "1 tunnel"
|
||||
msgid_plural "{0} tunnels"
|
||||
msgstr[0] "1 Tunnel"
|
||||
msgstr[1] "{0} Tunnel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1283
|
||||
msgid "Up to higher level directory"
|
||||
msgstr "Eine Hierachie nach oben"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "File"
|
||||
msgstr "Datei"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "Size"
|
||||
msgstr "Größe"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1311
|
||||
msgid "Directory"
|
||||
msgstr "Daten Verzeichnis"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1316
|
||||
msgid "Torrent not found?"
|
||||
msgstr "Torrentdatei nicht gefunden?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1324
|
||||
msgid "File not found in torrent?"
|
||||
msgstr "Datei nicht gefunden im Torrent?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1330
|
||||
msgid "complete"
|
||||
msgstr "Komplett"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1331
|
||||
msgid "bytes remaining"
|
||||
msgstr "Bytes noch übrig"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1456
|
||||
#, java-format
|
||||
msgid "Torrent fetched from {0}"
|
||||
msgstr "Torrent geholt von {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1484
|
||||
#, java-format
|
||||
msgid "Torrent at {0} was not valid"
|
||||
msgstr "Torrent bei {0} war nicht gültig"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1489
|
||||
#, java-format
|
||||
msgid "Torrent was not retrieved from {0}"
|
||||
msgstr "Torrent wurde nicht geladen von {0}"
|
||||
|
||||
#~ msgid "Cannot change the I2CP settings while torrents are active"
|
||||
#~ msgstr ""
|
||||
#~ "Kann nicht die I2CP Einstellungen ändern während Torrents aktiv sind."
|
||||
#~ msgid "Non-i2p tracker in \"{0}\", deleting it from our list of trackers!"
|
||||
#~ msgstr ""
|
||||
#~ "Nicht-I2P Tracker in\"{0}\", entferne ihn aus unserer Liste der Tracker!"
|
||||
#~ msgid "{0} torrents"
|
||||
#~ msgstr "{0} Torrents"
|
||||
#~ msgid "Uninteresting"
|
||||
#~ msgstr "nicht interessiert"
|
||||
#~ msgid "Choked"
|
||||
#~ msgstr "Gestaut"
|
||||
#~ msgid "Uninterested"
|
||||
#~ msgstr "Nicht interessiert"
|
||||
#~ msgid "Choking"
|
||||
#~ msgstr "Stau"
|
||||
#~ msgid "Custom tracker URL"
|
||||
#~ msgstr "Spezifische Tracker URL"
|
||||
#~ msgid "Configure"
|
||||
#~ msgstr "Einstellungen"
|
||||
|
775
apps/i2psnark/locale/messages_nl.po
Normal file
@ -0,0 +1,775 @@
|
||||
# I2P
|
||||
# Copyright (C) 2009 The I2P Project
|
||||
# This file is distributed under the same license as the i2psnark package.
|
||||
# To contribute translations, see http://www.i2p2.de/newdevelopers
|
||||
# foo <foo@bar>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P i2psnark\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-07-05 11:48+0000\n"
|
||||
"PO-Revision-Date: 2010-06-15 09:07+0100\n"
|
||||
"Last-Translator: duck <duck@mail.i2p>\n"
|
||||
"Language-Team: duck <duck@mail.i2p>, monkeybrains <monkeybrains@mail.i2p>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Language: Dutch\n"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:88
|
||||
#, java-format
|
||||
msgid "Adding torrents in {0} minutes"
|
||||
msgstr "Torrents toevoegen in {0} minuten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:258
|
||||
#, java-format
|
||||
msgid "Total uploaders limit changed to {0}"
|
||||
msgstr "Totale uploaders limiet gewijzigd in {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:260
|
||||
#, java-format
|
||||
msgid "Minimum total uploaders limit is {0}"
|
||||
msgstr "Minimum totale uploaders limiet is {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:272
|
||||
#, java-format
|
||||
msgid "Up BW limit changed to {0}KBps"
|
||||
msgstr "Up bandbreedte limiet gewijzigd in {0}KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:274
|
||||
#, java-format
|
||||
msgid "Minimum up bandwidth limit is {0}KBps"
|
||||
msgstr "Minimum up bandbreedte limiet is {0}KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:286
|
||||
#, java-format
|
||||
msgid "Startup delay limit changed to {0} minutes"
|
||||
msgstr "Startup vertragings limiet gewijzigd in {0} minuten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:333
|
||||
msgid "I2CP and tunnel changes will take effect after stopping all torrents"
|
||||
msgstr "I2CP en tunnel wijzigingen hebben pas effect na het stoppen van alle torrents"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:339
|
||||
msgid "Disconnecting old I2CP destination"
|
||||
msgstr "Oude I2CP destination wordt afgesloten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:343
|
||||
#, java-format
|
||||
msgid "I2CP settings changed to {0}"
|
||||
msgstr "I2CP instellingen gewijzigd in {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:347
|
||||
msgid ""
|
||||
"Unable to connect with the new settings, reverting to the old I2CP settings"
|
||||
msgstr "Kan geen connectie maken met de nieuwe instellingen, we keren terug naar oude I2CP instellingen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:351
|
||||
msgid "Unable to reconnect with the old settings!"
|
||||
msgstr "Kan niet opnieuw verbinden met de oude instellingen!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:353
|
||||
msgid "Reconnected on the new I2CP destination"
|
||||
msgstr "Opnieuw verbonden met de nieuwe I2CP destination"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:364
|
||||
#, java-format
|
||||
msgid "I2CP listener restarted for \"{0}\""
|
||||
msgstr "I2CP listener herstart voor \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:375
|
||||
msgid "Enabled autostart"
|
||||
msgstr "Autostart ingeschakeld"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:377
|
||||
msgid "Disabled autostart"
|
||||
msgstr "Autostart uitgeschakeld"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:383
|
||||
msgid "Enabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Open Trackers ingeschakeld - torrent herstart nodig."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:385
|
||||
msgid "Disabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Open Trackers uitgeschakeld - torrent herstart nodig."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:392
|
||||
msgid "Open Tracker list changed - torrent restart required to take effect."
|
||||
msgstr "Open Tracker lijst gewijzigd - torrent herstart nodig."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:399
|
||||
msgid "Configuration unchanged."
|
||||
msgstr "Configuratie ongewijzigd."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:409
|
||||
#, java-format
|
||||
msgid "Unable to save the config to {0}"
|
||||
msgstr "Kan de configuratie niet opslaan in {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:445
|
||||
msgid "Connecting to I2P"
|
||||
msgstr "Verbinden met I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:448
|
||||
msgid "Error connecting to I2P - check your I2CP settings!"
|
||||
msgstr "Fout bij verbinden met I2P - controlleer je I2CP instellingen!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:457
|
||||
#, java-format
|
||||
msgid "Error: Could not add the torrent {0}"
|
||||
msgstr "Fout: Kan de torrent {0} niet toevoegen"
|
||||
|
||||
#. catch this here so we don't try do delete it below
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:479
|
||||
#, java-format
|
||||
msgid "Cannot open \"{0}\""
|
||||
msgstr "Kan \"{0}\" niet openen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:492
|
||||
#, java-format
|
||||
msgid ""
|
||||
"Warning - Ignoring non-i2p tracker in \"{0}\", will announce to i2p open "
|
||||
"trackers only"
|
||||
msgstr "Waarschuwing - Niet-I2P tracker in \"{0}\" wordt genegeerd, zal alleen aankondigen naar i2p open trackers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:494
|
||||
#, java-format
|
||||
msgid ""
|
||||
"Warning - Ignoring non-i2p tracker in \"{0}\", and open trackers are "
|
||||
"disabled, you must enable open trackers before starting the torrent!"
|
||||
msgstr "Waarschuwing - Niet-I2P tracker in \"{0}\" wordt genegeerd, en open trackers zijn uitgeschakeld, je moet open trackers inschakelen voor het starten van de torrent!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:513
|
||||
#, java-format
|
||||
msgid "Torrent in \"{0}\" is invalid"
|
||||
msgstr "Torrent in \"{0}\" is ongeldig"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:528
|
||||
#, java-format
|
||||
msgid "Torrent added and started: \"{0}\""
|
||||
msgstr "Torrent toegevoegd en gestart: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:530
|
||||
#, java-format
|
||||
msgid "Torrent added: \"{0}\""
|
||||
msgstr "Torrent toegevoegd: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:627
|
||||
#, java-format
|
||||
msgid "Too many files in \"{0}\" ({1}), deleting it!"
|
||||
msgstr "Te veel bestanden in \"{0}\" ({1}), wordt verwijderd!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:629
|
||||
#, java-format
|
||||
msgid "Torrent file \"{0}\" cannot end in \".torrent\", deleting it!"
|
||||
msgstr "Torrent bestand \"{0}\" kan niet eindigen in \".torrent\", wordt verwijderd!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:631
|
||||
#, java-format
|
||||
msgid "No pieces in \"{0}\", deleting it!"
|
||||
msgstr "Geen stukken in \"{0}\", wordt verwijderd!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:633
|
||||
#, java-format
|
||||
msgid "Too many pieces in \"{0}\", limit is {1}, deleting it!"
|
||||
msgstr "Te veel stukken in \"{0}\", limiet is {1}, wordt verwijderd!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:635
|
||||
#, java-format
|
||||
msgid "Pieces are too large in \"{0}\" ({1}B), deleting it."
|
||||
msgstr "Stukken zijn te groot in \"{0}\" ({1}B), wordt verwijderd."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:636
|
||||
#, java-format
|
||||
msgid "Limit is {0}B"
|
||||
msgstr "Limiet is {0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:644
|
||||
#, java-format
|
||||
msgid "Torrents larger than {0}B are not supported yet, deleting \"{1}\""
|
||||
msgstr "Torrents groter dan {0}B worden nog niet ondersteund, verwijder \"{1}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:660
|
||||
#, java-format
|
||||
msgid "Error: Could not remove the torrent {0}"
|
||||
msgstr "Fout: Kan de torrent {0} niet verwijderen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:681
|
||||
#, java-format
|
||||
msgid "Torrent stopped: \"{0}\""
|
||||
msgstr "Torrent gestopt: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:696
|
||||
#, java-format
|
||||
msgid "Torrent removed: \"{0}\""
|
||||
msgstr "Torrent verwijderd: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "Download finished: \"{0}\""
|
||||
msgstr "Download gereed: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "size: {0}B"
|
||||
msgstr "grootte: {0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:757
|
||||
msgid "Unable to connect to I2P!"
|
||||
msgstr "Kan niet verbinden met I2P!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:174
|
||||
msgid "I2PSnark - Anonymous BitTorrent Client"
|
||||
msgstr "I2PSnark - Anonieme BitTorrent Client"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:185
|
||||
msgid "Torrents"
|
||||
msgstr "Torrents"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:187
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:193
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:837
|
||||
msgid "I2PSnark"
|
||||
msgstr "I2PSnark"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:191
|
||||
msgid "Refresh page"
|
||||
msgstr "Ververs pagina"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:195
|
||||
msgid "Forum"
|
||||
msgstr "Forum"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:240
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1289
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:246
|
||||
msgid "Hide Peers"
|
||||
msgstr "Verberg Peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:249
|
||||
msgid "Show Peers"
|
||||
msgstr "Toon Peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:254
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1271
|
||||
msgid "Torrent"
|
||||
msgstr "Torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:256
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:258
|
||||
msgid "Downloaded"
|
||||
msgstr "Gedownload"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:260
|
||||
msgid "Uploaded"
|
||||
msgstr "Geupload"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:262
|
||||
msgid "Down Rate"
|
||||
msgstr "Down Snelheid"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:264
|
||||
msgid "Up Rate"
|
||||
msgstr "Up Snelheid"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:271
|
||||
msgid "Stop all torrents and the I2P tunnel"
|
||||
msgstr "Stop alle torrents en de I2P tunnel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:273
|
||||
msgid "Stop All"
|
||||
msgstr "Stop Alle"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:278
|
||||
msgid "Start all torrents and the I2P tunnel"
|
||||
msgstr "Start alle torrents en de I2P tunnel"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:280
|
||||
msgid "Start All"
|
||||
msgstr "Start Alle"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:297
|
||||
msgid "No torrents loaded."
|
||||
msgstr "Geen torrents geladen."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:302
|
||||
msgid "Totals"
|
||||
msgstr "Totalen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:304
|
||||
#, java-format
|
||||
msgid "1 torrent"
|
||||
msgid_plural "{0} torrents"
|
||||
msgstr[0] "1 torrent"
|
||||
msgstr[1] "{0} torrents"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:307
|
||||
#, java-format
|
||||
msgid "1 connected peer"
|
||||
msgid_plural "{0} connected peers"
|
||||
msgstr[0] "1 verbonden peer"
|
||||
msgstr[1] "{0} verbonden peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:336
|
||||
#, java-format
|
||||
msgid "Torrent file {0} does not exist"
|
||||
msgstr "Torrent bestand {0} bestaat niet"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:346
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1476
|
||||
#, java-format
|
||||
msgid "Torrent already running: {0}"
|
||||
msgstr "Torrent draait al: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:348
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1478
|
||||
#, java-format
|
||||
msgid "Torrent already in the queue: {0}"
|
||||
msgstr "Torrent zit al in de wachtrij: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:352
|
||||
#, java-format
|
||||
msgid "Copying torrent to {0}"
|
||||
msgstr "Kopieer torrent naar {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "Unable to copy the torrent to {0}"
|
||||
msgstr "Kan de de torrent niet kopieren naar {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "from {0}"
|
||||
msgstr "van {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:363
|
||||
#, java-format
|
||||
msgid "Fetching {0}"
|
||||
msgstr "Downloaden {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:367
|
||||
msgid "Invalid URL - must start with http://"
|
||||
msgstr "Ongeldige URL - moet beginnen met http://"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:397
|
||||
#, java-format
|
||||
msgid "Starting up torrent {0}"
|
||||
msgstr "Starten met torrent {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:417
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:435
|
||||
#, java-format
|
||||
msgid "Torrent file deleted: {0}"
|
||||
msgstr "Torrent bestand verwijderd: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:441
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:451
|
||||
#, java-format
|
||||
msgid "Data file deleted: {0}"
|
||||
msgstr "Data bestand verwijderd: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:443
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:453
|
||||
#, java-format
|
||||
msgid "Data file could not be deleted: {0}"
|
||||
msgstr "Kan data bestand niet verwijderen: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:462
|
||||
#, java-format
|
||||
msgid "Data dir deleted: {0}"
|
||||
msgstr "Data directory verwijderd: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:494
|
||||
msgid "Error creating torrent - you must select a tracker"
|
||||
msgstr "Fout bij maken van torrent - je moet een tracker selecteren"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:509
|
||||
#, java-format
|
||||
msgid "Torrent created for \"{0}\""
|
||||
msgstr "Torrent gemaakt voor \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:512
|
||||
#, java-format
|
||||
msgid ""
|
||||
"Many I2P trackers require you to register new torrents before seeding - "
|
||||
"please do so before starting \"{0}\""
|
||||
msgstr "Veel I2P trackers vereisen dat je de nieuwe torrent registreert voor het seeden - "
|
||||
"doe dit voordat je \"{0}\" start"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:514
|
||||
#, java-format
|
||||
msgid "Error creating a torrent for \"{0}\""
|
||||
msgstr "Fout bij het maken van een torrent voor \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:517
|
||||
#, java-format
|
||||
msgid "Cannot create a torrent for the nonexistent data: {0}"
|
||||
msgstr "Kan geen torrent maken voor niet-bestaande data: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:520
|
||||
msgid "Error creating torrent - you must enter a file or directory"
|
||||
msgstr "Fout bij het maken van de torrent - je moet een bestand of directory invullen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:523
|
||||
msgid "Stopping all torrents and closing the I2P tunnel."
|
||||
msgstr "Stoppen van alle torrents en sluiten van I2P tunnel."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:532
|
||||
msgid "I2P tunnel closed."
|
||||
msgstr "I2P tunnel gesloten."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:535
|
||||
msgid "Opening the I2P tunnel and starting all torrents."
|
||||
msgstr "Openen van de I2P tunnel en starten van alle torrents."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:657
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:851
|
||||
msgid "Unknown"
|
||||
msgstr "Onbekend"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:660
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:665
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:670
|
||||
msgid "TrackerErr"
|
||||
msgstr "TrackerErr"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:663
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:666
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:677
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:680
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:688
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:691
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:696
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:699
|
||||
#, java-format
|
||||
msgid "1 peer"
|
||||
msgid_plural "{0} peers"
|
||||
msgstr[0] "1 peer"
|
||||
msgstr[1] "{0} peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:674
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:679
|
||||
msgid "Seeding"
|
||||
msgstr "Seeding"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:682
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1327
|
||||
msgid "Complete"
|
||||
msgstr "Voltooid"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:685
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:690
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:693
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:698
|
||||
msgid "Stalled"
|
||||
msgstr "Vastgelopen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:701
|
||||
msgid "No Peers"
|
||||
msgstr "Geen Peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:703
|
||||
msgid "Stopped"
|
||||
msgstr "Gestopt"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:718
|
||||
msgid "View files"
|
||||
msgstr "Bekijk bestanden"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:720
|
||||
msgid "Open file"
|
||||
msgstr "Open bestand"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:750
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:967
|
||||
msgid "Tracker"
|
||||
msgstr "Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:751
|
||||
msgid "Details"
|
||||
msgstr "Details"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:785
|
||||
msgid "Stop the torrent"
|
||||
msgstr "Stop de torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:787
|
||||
msgid "Stop"
|
||||
msgstr "Stop"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:793
|
||||
msgid "Start the torrent"
|
||||
msgstr "Start de torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:795
|
||||
msgid "Start"
|
||||
msgstr "Start"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:800
|
||||
msgid "Remove the torrent from the active list, deleting the .torrent file"
|
||||
msgstr "Verwijder de torrent van de actieve lijst, het .torrent bestand wordt verwijderd"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:805
|
||||
#, java-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete the file \\''{0}.torrent\\'' (downloaded "
|
||||
"data will not be deleted) ?"
|
||||
msgstr "Weet je zeker dat je het bestand \\''{0}.torrent\\'' wilt verwijderen (gedownloade data zal niet worden verwijderd) ?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:807
|
||||
msgid "Remove"
|
||||
msgstr "Weghalen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:811
|
||||
msgid "Delete the .torrent file and the associated data file(s)"
|
||||
msgstr "Verwijder het .torrent bestand en de gerelateerde data bestand(en)"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:816
|
||||
#, java-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded "
|
||||
"data?"
|
||||
msgstr "Weet je zeker dat je de torrent \\''{0}\\'' en alle gedownloade data wilt verwijderen?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:818
|
||||
msgid "Delete"
|
||||
msgstr "Verwijderen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:861
|
||||
msgid "Seed"
|
||||
msgstr "Seed"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:879
|
||||
msgid "Uninteresting (The peer has no pieces we need)"
|
||||
msgstr "Niet interessant (De peer heeft geen stukken die we nodig hebben)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:881
|
||||
msgid "Choked (The peer is not allowing us to request pieces)"
|
||||
msgstr "Verstikt (De peer laat ons niet toe om stukken op te vragen)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:895
|
||||
msgid "Uninterested (We have no pieces the peer needs)"
|
||||
msgstr "Niet geïnteresseerd (We heben geen stukken die de peer nodig heeft)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:897
|
||||
msgid "Choking (We are not allowing the peer to request pieces)"
|
||||
msgstr "Verstikt (We laten de peer niet toe om stukken op te vragen)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:927
|
||||
msgid "Add Torrent"
|
||||
msgstr "Torrent Toevoegen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:929
|
||||
msgid "From URL"
|
||||
msgstr "Van URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:934
|
||||
msgid "Add torrent"
|
||||
msgstr "Torrent toevoegen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:937
|
||||
#, java-format
|
||||
msgid "Alternately, you can copy .torrent files to the directory {0}."
|
||||
msgstr "Als alternatief kan je het .torrent bestand kopieren naar de directory {0}."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:939
|
||||
msgid "Removing a .torrent file will cause the torrent to stop."
|
||||
msgstr "Verwijderen van een .torrent bestand zorgt dat de torrent stopt."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:958
|
||||
msgid "Create Torrent"
|
||||
msgstr "Creëer Torrent"
|
||||
|
||||
#. out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n");
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:961
|
||||
msgid "Data to seed"
|
||||
msgstr "Data om te seeden"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:965
|
||||
msgid "File or directory to seed (must be within the specified path)"
|
||||
msgstr "Bestand of directory om te seeden (moet binnen het gespecificeerde pad zijn)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:969
|
||||
msgid "Select a tracker"
|
||||
msgstr "Selecteer een tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:982
|
||||
msgid "or"
|
||||
msgstr "of"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:985
|
||||
msgid "Specify custom tracker announce URL"
|
||||
msgstr "Specificeer aangepaste tracker aankondigings URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:988
|
||||
msgid "Create torrent"
|
||||
msgstr "Creëer torrent"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1006
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1133
|
||||
msgid "Configuration"
|
||||
msgstr "Configuratie"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1009
|
||||
msgid "Data directory"
|
||||
msgstr "Data directory"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1012
|
||||
msgid "Directory to store torrents and data"
|
||||
msgstr "Directory om torrents en data op te slaan"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1014
|
||||
msgid "Edit i2psnark.config and restart to change"
|
||||
msgstr "Bewerk i2psnark.config en herstart de wijziging"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1018
|
||||
msgid "Auto start"
|
||||
msgstr "Auto start"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1022
|
||||
msgid "If checked, automatically start torrents that are added"
|
||||
msgstr "Indien aangevinkt, start toegevoegde torrents automatisch"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1026
|
||||
msgid "Startup delay"
|
||||
msgstr "Startup vertraging"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1028
|
||||
msgid "minutes"
|
||||
msgstr "minuten"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1052
|
||||
msgid "Total uploader limit"
|
||||
msgstr "Totale uploader limiet"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1055
|
||||
msgid "peers"
|
||||
msgstr "peers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1059
|
||||
msgid "Up bandwidth limit"
|
||||
msgstr "Up bandbreedte limiet"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1062
|
||||
msgid "Half available bandwidth recommended."
|
||||
msgstr "Helft van beschikbare bandbreedte aanbevolen."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1064
|
||||
msgid "View or change router bandwidth"
|
||||
msgstr "Bekijk of wijzig router bandbreedte"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1068
|
||||
msgid "Use open trackers also"
|
||||
msgstr "Gebruik ook open trackers"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1072
|
||||
msgid ""
|
||||
"If checked, announce torrents to open trackers as well as the tracker listed "
|
||||
"in the torrent file"
|
||||
msgstr "Indien aangevinkt, kondig torrents ook aan bij de tracker uit het torrent bestand"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1076
|
||||
msgid "Open tracker announce URLs"
|
||||
msgstr "Open tracker aankondigings URLs"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1088
|
||||
msgid "Inbound Settings"
|
||||
msgstr "Inkomende Instellingen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1094
|
||||
msgid "Outbound Settings"
|
||||
msgstr "Uitgaande Instellingen"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1101
|
||||
msgid "I2CP host"
|
||||
msgstr "I2CP host"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1106
|
||||
msgid "I2CP port"
|
||||
msgstr "I2CP poort"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1118
|
||||
msgid "I2CP options"
|
||||
msgstr "I2CP opties"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1124
|
||||
msgid "Save configuration"
|
||||
msgstr "Configuratie opslaan"
|
||||
|
||||
#. * dummies for translation
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1141
|
||||
#, java-format
|
||||
msgid "1 hop"
|
||||
msgid_plural "{0} hops"
|
||||
msgstr[0] "1 hop"
|
||||
msgstr[1] "{0} hops"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1142
|
||||
#, java-format
|
||||
msgid "1 tunnel"
|
||||
msgid_plural "{0} tunnels"
|
||||
msgstr[0] "1 tunnel"
|
||||
msgstr[1] "{0} tunnels"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1283
|
||||
msgid "Up to higher level directory"
|
||||
msgstr "Naar bovenliggende directory"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "File"
|
||||
msgstr "Bestand"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "Size"
|
||||
msgstr "Grootte"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1311
|
||||
msgid "Directory"
|
||||
msgstr "Directory"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1316
|
||||
msgid "Torrent not found?"
|
||||
msgstr "Torrent niet gevonden?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1324
|
||||
msgid "File not found in torrent?"
|
||||
msgstr "Bestand niet gevonden in torrent?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1330
|
||||
msgid "complete"
|
||||
msgstr "voltooid"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1331
|
||||
msgid "bytes remaining"
|
||||
msgstr "bytes resterend"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1456
|
||||
#, java-format
|
||||
msgid "Torrent fetched from {0}"
|
||||
msgstr "Torrent gedownload van {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1484
|
||||
#, java-format
|
||||
msgid "Torrent at {0} was not valid"
|
||||
msgstr "Torrent op {0} was niet geldig"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1489
|
||||
#, java-format
|
||||
msgid "Torrent was not retrieved from {0}"
|
||||
msgstr "Torrent was niet ontvangen van {0}"
|
772
apps/i2psnark/locale/messages_ru.po
Normal file
@ -0,0 +1,772 @@
|
||||
# I2P
|
||||
# Copyright (C) 2009 The I2P Project
|
||||
# This file is distributed under the same license as the i2psnark package.
|
||||
# To contribute translations, see http://www.i2p2.de/newdevelopers
|
||||
# foo <foo@bar>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P i2psnark\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-06-26 21:02+0000\n"
|
||||
"PO-Revision-Date: 2010-06-26 21:13+0000\n"
|
||||
"Last-Translator: 4get <forget@mail.i2p>\n"
|
||||
"Language-Team: foo <foo@bar>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Language: Russian\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:88
|
||||
#, java-format
|
||||
msgid "Adding torrents in {0} minutes"
|
||||
msgstr "Торренты будут подгружены через {0} минут(ы)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:258
|
||||
#, java-format
|
||||
msgid "Total uploaders limit changed to {0}"
|
||||
msgstr "Новое значение лимита количества слотов отдачи: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:260
|
||||
#, java-format
|
||||
msgid "Minimum total uploaders limit is {0}"
|
||||
msgstr "Минимально допустимое значение для количества слотов: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:272
|
||||
#, java-format
|
||||
msgid "Up BW limit changed to {0}KBps"
|
||||
msgstr "Новое значение лимита скорости отдачи: {0} KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:274
|
||||
#, java-format
|
||||
msgid "Minimum up bandwidth limit is {0}KBps"
|
||||
msgstr "Минимально допустимое значение для лимита скорости отдачи: {0} KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:286
|
||||
#, java-format
|
||||
msgid "Startup delay limit changed to {0} minutes"
|
||||
msgstr "Новое значение задержки запуска: {0} минут(ы)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:333
|
||||
msgid "I2CP and tunnel changes will take effect after stopping all torrents"
|
||||
msgstr "Изменения настроек I2CP и туннелей вступят в силу после остановки всех торрентов."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:339
|
||||
msgid "Disconnecting old I2CP destination"
|
||||
msgstr "Рассоединяемся по старому адресу I2CP"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:343
|
||||
#, java-format
|
||||
msgid "I2CP settings changed to {0}"
|
||||
msgstr "Новые параметры I2CP: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:347
|
||||
msgid "Unable to connect with the new settings, reverting to the old I2CP settings"
|
||||
msgstr "Не удалось соединиться с использованием новых настроек I2CP, возвращаемся к старым настройкам"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:351
|
||||
msgid "Unable to reconnect with the old settings!"
|
||||
msgstr "Не удалось пересоединиться с использованием старых настроек I2CP!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:353
|
||||
msgid "Reconnected on the new I2CP destination"
|
||||
msgstr "Пересоединились по новому адресу I2CP"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:364
|
||||
#, java-format
|
||||
msgid "I2CP listener restarted for \"{0}\""
|
||||
msgstr "I2CP-приёмник перезапущен для \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:375
|
||||
msgid "Enabled autostart"
|
||||
msgstr "Автостарт включен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:377
|
||||
msgid "Disabled autostart"
|
||||
msgstr "Автостарт выключен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:383
|
||||
msgid "Enabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Включено использование открытых трекеров. Требуется перезапуск торрента, чтобы изменения вступили в силу."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:385
|
||||
msgid "Disabled open trackers - torrent restart required to take effect."
|
||||
msgstr "Отключено использование открытых трекеров. Требуется перезапуск торрента, чтобы изменения вступили в силу."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:392
|
||||
msgid "Open Tracker list changed - torrent restart required to take effect."
|
||||
msgstr "Изменен список открытых трекеров. Требуется перезапуск торрента, чтобы изменения вступили в силу."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:399
|
||||
msgid "Configuration unchanged."
|
||||
msgstr "Настройки не изменились."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:409
|
||||
#, java-format
|
||||
msgid "Unable to save the config to {0}"
|
||||
msgstr "Не удалось сохранить настройки в {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:445
|
||||
msgid "Connecting to I2P"
|
||||
msgstr "Устанавливается соединение с I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:448
|
||||
msgid "Error connecting to I2P - check your I2CP settings!"
|
||||
msgstr "Ошибка соединения с I2P, проверьте настройки I2CP!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:457
|
||||
#, java-format
|
||||
msgid "Error: Could not add the torrent {0}"
|
||||
msgstr "Ошибка: Не удалось добавить торрент {0}"
|
||||
|
||||
#. catch this here so we don't try do delete it below
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:479
|
||||
#, java-format
|
||||
msgid "Cannot open \"{0}\""
|
||||
msgstr "Не удалось открыть \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:492
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", will announce to i2p open trackers only"
|
||||
msgstr "Внимание: указанные в \"{0}\" не-i2p трекеры будут проигнорированы, будут использоваться только открытые i2p трекеры"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:494
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", and open trackers are disabled, you must enable open trackers before starting the torrent!"
|
||||
msgstr "Внимание: указанные в \"{0}\" не-i2p трекеры будут проигнорированы, однако использование открытых i2p трекеров отключено, Вы должны включить поддержку открытых i2p трекеров перед запуском этого торрента!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:513
|
||||
#, java-format
|
||||
msgid "Torrent in \"{0}\" is invalid"
|
||||
msgstr "Торрент в \"{0}\" некорректен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:528
|
||||
#, java-format
|
||||
msgid "Torrent added and started: \"{0}\""
|
||||
msgstr "Торрент добавлен и запущен: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:530
|
||||
#, java-format
|
||||
msgid "Torrent added: \"{0}\""
|
||||
msgstr "Торрент добавлен: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:627
|
||||
#, java-format
|
||||
msgid "Too many files in \"{0}\" ({1}), deleting it!"
|
||||
msgstr "Слишком много файлов в торренте \"{0}\" ({1}), удаляем его!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:629
|
||||
#, java-format
|
||||
msgid "Torrent file \"{0}\" cannot end in \".torrent\", deleting it!"
|
||||
msgstr "Торрент \"{0}\" содержит единственный файл заканчивающийся на \".torrent\", удаляем его!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:631
|
||||
#, java-format
|
||||
msgid "No pieces in \"{0}\", deleting it!"
|
||||
msgstr "В торренте \"{0}\" не оказалось ни одной части, удаляем его!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:633
|
||||
#, java-format
|
||||
msgid "Too many pieces in \"{0}\", limit is {1}, deleting it!"
|
||||
msgstr "Слишком много частей в торренте \"{0}\" (наш предел {1}), удаляем его!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:635
|
||||
#, java-format
|
||||
msgid "Pieces are too large in \"{0}\" ({1}B), deleting it."
|
||||
msgstr "Слишком крупные части в торренте \"{0}\" ({1}B), удаляем его."
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:636
|
||||
#, java-format
|
||||
msgid "Limit is {0}B"
|
||||
msgstr "Наш предел {0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:644
|
||||
#, java-format
|
||||
msgid "Torrents larger than {0}B are not supported yet, deleting \"{1}\""
|
||||
msgstr "Торренты крупнее чем {0}B пока не поддерживается, удаляем \"{1}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:660
|
||||
#, java-format
|
||||
msgid "Error: Could not remove the torrent {0}"
|
||||
msgstr "Ошибка: Невозможно удалить торрент {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:681
|
||||
#, java-format
|
||||
msgid "Torrent stopped: \"{0}\""
|
||||
msgstr "Торрент остановлен: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:696
|
||||
#, java-format
|
||||
msgid "Torrent removed: \"{0}\""
|
||||
msgstr "Торрент удален: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "Download finished: \"{0}\""
|
||||
msgstr "Завершена загрузка: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "size: {0}B"
|
||||
msgstr "размер: {0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:757
|
||||
msgid "Unable to connect to I2P!"
|
||||
msgstr "Не удалось установить соединение с I2P!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:168
|
||||
msgid "I2PSnark - Anonymous BitTorrent Client"
|
||||
msgstr "I2PSnark — Анонимный BitTorrent Клиент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:179
|
||||
msgid "Torrents"
|
||||
msgstr "Торренты"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:181
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:187
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:831
|
||||
msgid "I2PSnark"
|
||||
msgstr "I2PSnark"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:185
|
||||
msgid "Refresh page"
|
||||
msgstr "Обновить страницу"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:189
|
||||
msgid "Forum"
|
||||
msgstr "Форум"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:234
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1283
|
||||
msgid "Status"
|
||||
msgstr "Статус"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:240
|
||||
msgid "Hide Peers"
|
||||
msgstr "спрятать список пиров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:243
|
||||
msgid "Show Peers"
|
||||
msgstr "показать список пиров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:248
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1265
|
||||
msgid "Torrent"
|
||||
msgstr "Торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:250
|
||||
msgid "ETA"
|
||||
msgstr "Осталось"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:252
|
||||
msgid "Downloaded"
|
||||
msgstr "Получено"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:254
|
||||
msgid "Uploaded"
|
||||
msgstr "Отдано"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:256
|
||||
msgid "Down Rate"
|
||||
msgstr "Скорость загрузки"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:258
|
||||
msgid "Up Rate"
|
||||
msgstr "Скорость отдачи"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:265
|
||||
msgid "Stop all torrents and the I2P tunnel"
|
||||
msgstr "Остановить все торренты и закрыть соединение с I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:267
|
||||
msgid "Stop All"
|
||||
msgstr "Остановить все"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:272
|
||||
msgid "Start all torrents and the I2P tunnel"
|
||||
msgstr "Запустить все торренты и открыть соединение с I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:274
|
||||
msgid "Start All"
|
||||
msgstr "Запустить все"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:291
|
||||
msgid "No torrents loaded."
|
||||
msgstr "Нет загруженных торрентов."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:296
|
||||
msgid "Totals"
|
||||
msgstr "Всего"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:298
|
||||
#, java-format
|
||||
msgid "1 torrent"
|
||||
msgid_plural "{0} torrents"
|
||||
msgstr[0] "{0} торрент"
|
||||
msgstr[1] "{0} торрента"
|
||||
msgstr[2] "{0} торрентов"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:301
|
||||
#, java-format
|
||||
msgid "1 connected peer"
|
||||
msgid_plural "{0} connected peers"
|
||||
msgstr[0] "{0} подсоединенный пир"
|
||||
msgstr[1] "{0} подсоединенных пиров"
|
||||
msgstr[2] "{0} подсоединенных пиров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:330
|
||||
#, java-format
|
||||
msgid "Torrent file {0} does not exist"
|
||||
msgstr "Торрент {0} не существует"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:340
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1470
|
||||
#, java-format
|
||||
msgid "Torrent already running: {0}"
|
||||
msgstr "Торрент уже запущен: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:342
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1472
|
||||
#, java-format
|
||||
msgid "Torrent already in the queue: {0}"
|
||||
msgstr "Торрент уже в очереди: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:346
|
||||
#, java-format
|
||||
msgid "Copying torrent to {0}"
|
||||
msgstr "Копируем торрент в: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:349
|
||||
#, java-format
|
||||
msgid "Unable to copy the torrent to {0}"
|
||||
msgstr "Не удалось скопировать торрент в: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:349
|
||||
#, java-format
|
||||
msgid "from {0}"
|
||||
msgstr "из: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:357
|
||||
#, java-format
|
||||
msgid "Fetching {0}"
|
||||
msgstr "Получение торрента: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:361
|
||||
msgid "Invalid URL - must start with http://"
|
||||
msgstr "Некорректный URL, должен начинаться с http://"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:391
|
||||
#, java-format
|
||||
msgid "Starting up torrent {0}"
|
||||
msgstr "Запускаем торрент: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:411
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:429
|
||||
#, java-format
|
||||
msgid "Torrent file deleted: {0}"
|
||||
msgstr "Удален торрент: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:435
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:445
|
||||
#, java-format
|
||||
msgid "Data file deleted: {0}"
|
||||
msgstr "Файл удален: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:437
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:447
|
||||
#, java-format
|
||||
msgid "Data file could not be deleted: {0}"
|
||||
msgstr "Не удалось удалить файл: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:456
|
||||
#, java-format
|
||||
msgid "Data dir deleted: {0}"
|
||||
msgstr "Директория удалена: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:488
|
||||
msgid "Error creating torrent - you must select a tracker"
|
||||
msgstr "Торрент не создан — вы должны указать трекер"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:503
|
||||
#, java-format
|
||||
msgid "Torrent created for \"{0}\""
|
||||
msgstr "Создан торрент для \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:506
|
||||
#, java-format
|
||||
msgid "Many I2P trackers require you to register new torrents before seeding - please do so before starting \"{0}\""
|
||||
msgstr "Многие I2P трекеры требуют зарегистрировать на них торрент перед началом раздачи — пожалуйста проверьте требуется ли это перед запуском \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:508
|
||||
#, java-format
|
||||
msgid "Error creating a torrent for \"{0}\""
|
||||
msgstr "Ошибка при создании торрента для: \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:511
|
||||
#, java-format
|
||||
msgid "Cannot create a torrent for the nonexistent data: {0}"
|
||||
msgstr "Невозможно создать торрент для несуществующего файла или директории: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:514
|
||||
msgid "Error creating torrent - you must enter a file or directory"
|
||||
msgstr "Торрент не создан — вы должны указать файл или директорию"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:517
|
||||
msgid "Stopping all torrents and closing the I2P tunnel."
|
||||
msgstr "Останавливаем все торренты и закрываем соединение с I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:526
|
||||
msgid "I2P tunnel closed."
|
||||
msgstr "Соединение с I2P закрыто."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:529
|
||||
msgid "Opening the I2P tunnel and starting all torrents."
|
||||
msgstr "Соединяемся с I2P и запускаем все торренты."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:651
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:845
|
||||
msgid "Unknown"
|
||||
msgstr "Неизвестный"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:654
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:659
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:664
|
||||
msgid "TrackerErr"
|
||||
msgstr "ОшибкаТрекера"
|
||||
|
||||
# TODO should replace "uploader limit NN peers" with "global number of upload slots: NN"
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:657
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:660
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:671
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:674
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:682
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:685
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:690
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:693
|
||||
#, java-format
|
||||
msgid "1 peer"
|
||||
msgid_plural "{0} peers"
|
||||
msgstr[0] "{0} пир"
|
||||
msgstr[1] "{0} пира"
|
||||
msgstr[2] "{0} пиров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:668
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:673
|
||||
msgid "Seeding"
|
||||
msgstr "Раздается"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:676
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1321
|
||||
msgid "Complete"
|
||||
msgstr "Завершен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:679
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:684
|
||||
msgid "OK"
|
||||
msgstr "Загружается"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:687
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:692
|
||||
msgid "Stalled"
|
||||
msgstr "Простаивает"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:695
|
||||
msgid "No Peers"
|
||||
msgstr "Нет Пиров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:697
|
||||
msgid "Stopped"
|
||||
msgstr "Остановлен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:712
|
||||
msgid "View files"
|
||||
msgstr "Открыть директорию"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:714
|
||||
msgid "Open file"
|
||||
msgstr "Открыть файл"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:744
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:961
|
||||
msgid "Tracker"
|
||||
msgstr "Трекер"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:745
|
||||
msgid "Details"
|
||||
msgstr "Подробнее"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:779
|
||||
msgid "Stop the torrent"
|
||||
msgstr "Остановить торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:781
|
||||
msgid "Stop"
|
||||
msgstr "Остановить"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:787
|
||||
msgid "Start the torrent"
|
||||
msgstr "Запустить торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:789
|
||||
msgid "Start"
|
||||
msgstr "Запустить"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:794
|
||||
msgid "Remove the torrent from the active list, deleting the .torrent file"
|
||||
msgstr "Удалить торрент из списка и с диска"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:799
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the file \\''{0}.torrent\\'' (downloaded data will not be deleted) ?"
|
||||
msgstr "Вы действительно хотите удалить \\''{0}.torrent\\''? (загруженные файлы удаляться НЕ будут)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:801
|
||||
msgid "Remove"
|
||||
msgstr "Удалить"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:805
|
||||
msgid "Delete the .torrent file and the associated data file(s)"
|
||||
msgstr "Удалить торрент и стереть загруженные файлы"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:810
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded data?"
|
||||
msgstr "Вы действительно хотите удалить торрент \\''{0}\\'' и все загруженные файлы?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:812
|
||||
msgid "Delete"
|
||||
msgstr "Стереть"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:855
|
||||
msgid "Seed"
|
||||
msgstr "Сид"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:873
|
||||
msgid "Uninteresting (The peer has no pieces we need)"
|
||||
msgstr "Uninteresting (У пира нет нужных нам частей торрента)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:875
|
||||
msgid "Choked (The peer is not allowing us to request pieces)"
|
||||
msgstr "Choked (Этот пир не позволяет нам запрашивать части торрента)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:889
|
||||
msgid "Uninterested (We have no pieces the peer needs)"
|
||||
msgstr "Uninterested (У нас нужных этому пиру частей торрента)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:891
|
||||
msgid "Choking (We are not allowing the peer to request pieces)"
|
||||
msgstr "Choking (Мы не позволяем этому пиру запрашивать у нас части торрента)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:921
|
||||
msgid "Add Torrent"
|
||||
msgstr "Добавить Торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:923
|
||||
msgid "From URL"
|
||||
msgstr "Из URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:928
|
||||
msgid "Add torrent"
|
||||
msgstr "Добавить торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:931
|
||||
#, java-format
|
||||
msgid "Alternately, you can copy .torrent files to the directory {0}."
|
||||
msgstr "Ну или вы можете скопировать .torrent-файлы в директорию {0}."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:933
|
||||
msgid "Removing a .torrent file will cause the torrent to stop."
|
||||
msgstr "Удаление .torrent-файла приведет к остановке торрента."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:952
|
||||
msgid "Create Torrent"
|
||||
msgstr "Создать Торрент"
|
||||
|
||||
#. out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n");
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:955
|
||||
msgid "Data to seed"
|
||||
msgstr "Файлы для раздачи"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:959
|
||||
msgid "File or directory to seed (must be within the specified path)"
|
||||
msgstr "Файл или директория для раздачи (вводите только название файла или директории, указание абсолютных путей не поддерживается)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:963
|
||||
msgid "Select a tracker"
|
||||
msgstr "Выбрать трекер"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:976
|
||||
msgid "or"
|
||||
msgstr "или"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:979
|
||||
msgid "Specify custom tracker announce URL"
|
||||
msgstr "Задать URL анонсера вручную"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:982
|
||||
msgid "Create torrent"
|
||||
msgstr "Создать торрент"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1000
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1127
|
||||
msgid "Configuration"
|
||||
msgstr "Настройки"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1003
|
||||
msgid "Data directory"
|
||||
msgstr "Директория для файлов"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1006
|
||||
msgid "Directory to store torrents and data"
|
||||
msgstr "Директория, где будут храниться торренты и загружаемые файлы"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1008
|
||||
msgid "Edit i2psnark.config and restart to change"
|
||||
msgstr "Для изменения отредактируйте файл i2psnark.config и перезагрузите I2PSnark"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1012
|
||||
msgid "Auto start"
|
||||
msgstr "Автозапуск"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1016
|
||||
msgid "If checked, automatically start torrents that are added"
|
||||
msgstr "Автоматически запускать торренты после добавления"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1020
|
||||
msgid "Startup delay"
|
||||
msgstr "Задержка запуска"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1022
|
||||
msgid "minutes"
|
||||
msgstr "минут"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1046
|
||||
msgid "Total uploader limit"
|
||||
msgstr "Ограничение количества слотов отдачи"
|
||||
|
||||
# TODO should replace "uploader limit NN peers" with "global number of upload slots: NN"
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1049
|
||||
msgid "peers"
|
||||
msgstr "пир."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1053
|
||||
msgid "Up bandwidth limit"
|
||||
msgstr "Ограничение скорости отдачи"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1056
|
||||
msgid "Half available bandwidth recommended."
|
||||
msgstr "Рекомендуется использовать половину от доступной пропускной способности."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1058
|
||||
msgid "View or change router bandwidth"
|
||||
msgstr "Посмотреть/настроить ограничения скорости в маршрутизаторе I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1062
|
||||
msgid "Use open trackers also"
|
||||
msgstr "Дополнительно использовать открытые трекеры"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1066
|
||||
msgid "If checked, announce torrents to open trackers as well as the tracker listed in the torrent file"
|
||||
msgstr "Анонсировать торренты на открытых трекерах, дополнительно к тем, что указаны внутри торрента"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1070
|
||||
msgid "Open tracker announce URLs"
|
||||
msgstr "URL открытых трекеров"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1082
|
||||
msgid "Inbound Settings"
|
||||
msgstr "Входящие туннели"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1088
|
||||
msgid "Outbound Settings"
|
||||
msgstr "Исходящие туннели"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1095
|
||||
msgid "I2CP host"
|
||||
msgstr "Адрес I2CP"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1100
|
||||
msgid "I2CP port"
|
||||
msgstr "Порт I2CP"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1112
|
||||
msgid "I2CP options"
|
||||
msgstr "Параметры I2CP"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1118
|
||||
msgid "Save configuration"
|
||||
msgstr "Сохранить настройки"
|
||||
|
||||
#. * dummies for translation
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1135
|
||||
#, java-format
|
||||
msgid "1 hop"
|
||||
msgid_plural "{0} hops"
|
||||
msgstr[0] "{0} хоп"
|
||||
msgstr[1] "{0} хопа"
|
||||
msgstr[2] "{0} хопов"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1136
|
||||
#, java-format
|
||||
msgid "1 tunnel"
|
||||
msgid_plural "{0} tunnels"
|
||||
msgstr[0] "{0} туннель"
|
||||
msgstr[1] "{0} туннеля"
|
||||
msgstr[2] "{0} туннелей"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1277
|
||||
msgid "Up to higher level directory"
|
||||
msgstr "Перейти в директорию уровнем выше"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1282
|
||||
msgid "File"
|
||||
msgstr "Файл"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1282
|
||||
msgid "Size"
|
||||
msgstr "Размер"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1305
|
||||
msgid "Directory"
|
||||
msgstr "Директория"
|
||||
|
||||
# This debug error message intentionally left in English
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1310
|
||||
msgid "Torrent not found?"
|
||||
msgstr "Torrent not found?"
|
||||
|
||||
# This debug error message intentionally left in English
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1318
|
||||
msgid "File not found in torrent?"
|
||||
msgstr "File not found in torrent?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1324
|
||||
msgid "complete"
|
||||
msgstr "скачано"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1325
|
||||
msgid "bytes remaining"
|
||||
msgstr "байт осталось"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1450
|
||||
#, java-format
|
||||
msgid "Torrent fetched from {0}"
|
||||
msgstr "Получен торрент из: {0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1478
|
||||
#, java-format
|
||||
msgid "Torrent at {0} was not valid"
|
||||
msgstr "Торрент полученный из {0} некорректен"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1483
|
||||
#, java-format
|
||||
msgid "Torrent was not retrieved from {0}"
|
||||
msgstr "Не удалось получить торрент из: {0}"
|
||||
|
770
apps/i2psnark/locale/messages_zh.po
Normal file
@ -0,0 +1,770 @@
|
||||
# I2P
|
||||
# Copyright (C) 2009 The I2P Project
|
||||
# This file is distributed under the same license as the i2psnark package.
|
||||
# To contribute translations, see http://www.i2p2.de/newdevelopers
|
||||
# foo <foo@bar>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P i2psnark\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-07-01 04:52+0000\n"
|
||||
"PO-Revision-Date: 2010-07-01 12:53+0800\n"
|
||||
"Last-Translator: walking <walking@mail.i2p>\n"
|
||||
"Language-Team: foo <foo@bar>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Language: Chinese\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:88
|
||||
#, java-format
|
||||
msgid "Adding torrents in {0} minutes"
|
||||
msgstr "{0}分钟内完成添加"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:258
|
||||
#, java-format
|
||||
msgid "Total uploaders limit changed to {0}"
|
||||
msgstr "总上传种子数限制已更新为{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:260
|
||||
#, java-format
|
||||
msgid "Minimum total uploaders limit is {0}"
|
||||
msgstr "最低上传种子数限制为{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:272
|
||||
#, java-format
|
||||
msgid "Up BW limit changed to {0}KBps"
|
||||
msgstr "上传带宽限制改为 {0} KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:274
|
||||
#, java-format
|
||||
msgid "Minimum up bandwidth limit is {0}KBps"
|
||||
msgstr "最小上传带宽限制为 {0} KBps"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:286
|
||||
#, java-format
|
||||
msgid "Startup delay limit changed to {0} minutes"
|
||||
msgstr "启动延迟已更新为{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:333
|
||||
msgid "I2CP and tunnel changes will take effect after stopping all torrents"
|
||||
msgstr "I2CP与隧道设置的变化在所有种子停止后才能生效"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:339
|
||||
msgid "Disconnecting old I2CP destination"
|
||||
msgstr "正在断开旧的I2CP目标"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:343
|
||||
#, java-format
|
||||
msgid "I2CP settings changed to {0}"
|
||||
msgstr "I2CP设置改为{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:347
|
||||
msgid "Unable to connect with the new settings, reverting to the old I2CP settings"
|
||||
msgstr "无法通过新设置连接,恢复I2CP的旧设置"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:351
|
||||
msgid "Unable to reconnect with the old settings!"
|
||||
msgstr "旧设置也无法连接!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:353
|
||||
msgid "Reconnected on the new I2CP destination"
|
||||
msgstr "重新连接新I2CP目标"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:364
|
||||
#, java-format
|
||||
msgid "I2CP listener restarted for \"{0}\""
|
||||
msgstr "\"{0}\"的I2CP监听端口已启动"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:375
|
||||
msgid "Enabled autostart"
|
||||
msgstr "启用自动启动"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:377
|
||||
msgid "Disabled autostart"
|
||||
msgstr "禁用自动启动"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:383
|
||||
msgid "Enabled open trackers - torrent restart required to take effect."
|
||||
msgstr "启用OpenTracker-重新启动种子后生效"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:385
|
||||
msgid "Disabled open trackers - torrent restart required to take effect."
|
||||
msgstr "禁用OpenTracker - 重新启动种子后生效"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:392
|
||||
msgid "Open Tracker list changed - torrent restart required to take effect."
|
||||
msgstr "OpenTracker列表已改变 - 重新启动种子后生效"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:399
|
||||
msgid "Configuration unchanged."
|
||||
msgstr "设置未改变"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:409
|
||||
#, java-format
|
||||
msgid "Unable to save the config to {0}"
|
||||
msgstr "无法保存设置到{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:445
|
||||
msgid "Connecting to I2P"
|
||||
msgstr "正在连接到I2P"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:448
|
||||
msgid "Error connecting to I2P - check your I2CP settings!"
|
||||
msgstr "连接I2P时发生错误 - 请检查I2CP设置!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:457
|
||||
#, java-format
|
||||
msgid "Error: Could not add the torrent {0}"
|
||||
msgstr "错误:无法添加种子{0}"
|
||||
|
||||
#. catch this here so we don't try do delete it below
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:479
|
||||
#, java-format
|
||||
msgid "Cannot open \"{0}\""
|
||||
msgstr "无法打开 \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:492
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", will announce to i2p open trackers only"
|
||||
msgstr "警告 - 忽略\"{0}\"文件中I2P网络外的Tracker服务器,文件将仅发布至 I2P 内的 Open Tracker 服务器。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:494
|
||||
#, java-format
|
||||
msgid "Warning - Ignoring non-i2p tracker in \"{0}\", and open trackers are disabled, you must enable open trackers before starting the torrent!"
|
||||
msgstr "警告 - 忽略\"{0}\"文件中I2P网络外的Tracker服务器,OpenTracker已禁用,启动此种子前您必须启用OpenTracker。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:513
|
||||
#, java-format
|
||||
msgid "Torrent in \"{0}\" is invalid"
|
||||
msgstr "无效种子 \"{0}\" "
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:528
|
||||
#, java-format
|
||||
msgid "Torrent added and started: \"{0}\""
|
||||
msgstr "已添加并启动种子:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:530
|
||||
#, java-format
|
||||
msgid "Torrent added: \"{0}\""
|
||||
msgstr "已添加种子:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:627
|
||||
#, java-format
|
||||
msgid "Too many files in \"{0}\" ({1}), deleting it!"
|
||||
msgstr "\"{0}\" ({1}) 含有太多文件,删除之!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:629
|
||||
#, java-format
|
||||
msgid "Torrent file \"{0}\" cannot end in \".torrent\", deleting it!"
|
||||
msgstr "种子文件 \"{0}\" 不以 \".torrent\"结尾,正在删除!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:631
|
||||
#, java-format
|
||||
msgid "No pieces in \"{0}\", deleting it!"
|
||||
msgstr "\"{0}\" 中没有数据片,删除之!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:633
|
||||
#, java-format
|
||||
msgid "Too many pieces in \"{0}\", limit is {1}, deleting it!"
|
||||
msgstr "\"{0}\" 中文件分片太多,限额为{1},删除之!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:635
|
||||
#, java-format
|
||||
msgid "Pieces are too large in \"{0}\" ({1}B), deleting it."
|
||||
msgstr "\"{0}\" ({1}B) 中文件分片过大,删除之。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:636
|
||||
#, java-format
|
||||
msgid "Limit is {0}B"
|
||||
msgstr "限额为 {0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:644
|
||||
#, java-format
|
||||
msgid "Torrents larger than {0}B are not supported yet, deleting \"{1}\""
|
||||
msgstr "目前不支持大于{0}B 的种子,正在删除\"{1}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:660
|
||||
#, java-format
|
||||
msgid "Error: Could not remove the torrent {0}"
|
||||
msgstr "错误:无法删除种子{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:681
|
||||
#, java-format
|
||||
msgid "Torrent stopped: \"{0}\""
|
||||
msgstr "种子已停止:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:696
|
||||
#, java-format
|
||||
msgid "Torrent removed: \"{0}\""
|
||||
msgstr "种子已删除:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "Download finished: \"{0}\""
|
||||
msgstr "下载已完成:\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:729
|
||||
#, java-format
|
||||
msgid "size: {0}B"
|
||||
msgstr "大小:{0}B"
|
||||
|
||||
#: ../java/src/org/klomp/snark/SnarkManager.java:757
|
||||
msgid "Unable to connect to I2P!"
|
||||
msgstr "无法连接至I2P!"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:174
|
||||
msgid "I2PSnark - Anonymous BitTorrent Client"
|
||||
msgstr "I2PSnark - 匿名BitTorrent客户端"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:185
|
||||
msgid "Torrents"
|
||||
msgstr "种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:187
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:193
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:837
|
||||
msgid "I2PSnark"
|
||||
msgstr ""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:191
|
||||
msgid "Refresh page"
|
||||
msgstr "刷新页面"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:195
|
||||
msgid "Forum"
|
||||
msgstr "论坛"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:240
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1289
|
||||
msgid "Status"
|
||||
msgstr "状态"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:246
|
||||
msgid "Hide Peers"
|
||||
msgstr "隐藏用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:249
|
||||
msgid "Show Peers"
|
||||
msgstr "显示用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:254
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1271
|
||||
msgid "Torrent"
|
||||
msgstr "种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:256
|
||||
msgid "ETA"
|
||||
msgstr "预计剩余时间"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:258
|
||||
msgid "Downloaded"
|
||||
msgstr "已下载"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:260
|
||||
msgid "Uploaded"
|
||||
msgstr "已上传"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:262
|
||||
msgid "Down Rate"
|
||||
msgstr "下载速度"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:264
|
||||
msgid "Up Rate"
|
||||
msgstr "上传速度"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:271
|
||||
msgid "Stop all torrents and the I2P tunnel"
|
||||
msgstr "停止全部种子及I2P隧道"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:273
|
||||
msgid "Stop All"
|
||||
msgstr "停止全部"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:278
|
||||
msgid "Start all torrents and the I2P tunnel"
|
||||
msgstr "启动全部种子及I2P隧道"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:280
|
||||
msgid "Start All"
|
||||
msgstr "启动全部"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:297
|
||||
msgid "No torrents loaded."
|
||||
msgstr "未载入任何种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:302
|
||||
msgid "Totals"
|
||||
msgstr "总计"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:304
|
||||
#, java-format
|
||||
msgid "1 torrent"
|
||||
msgid_plural "{0} torrents"
|
||||
msgstr[0] "{0}个种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:307
|
||||
#, java-format
|
||||
msgid "1 connected peer"
|
||||
msgid_plural "{0} connected peers"
|
||||
msgstr[0] "{0}个已连接用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:336
|
||||
#, java-format
|
||||
msgid "Torrent file {0} does not exist"
|
||||
msgstr "种子文件{0}不存在"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:346
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1476
|
||||
#, java-format
|
||||
msgid "Torrent already running: {0}"
|
||||
msgstr "种子已启动:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:348
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1478
|
||||
#, java-format
|
||||
msgid "Torrent already in the queue: {0}"
|
||||
msgstr "种子排队中:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:352
|
||||
#, java-format
|
||||
msgid "Copying torrent to {0}"
|
||||
msgstr "正在复制种子到{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "Unable to copy the torrent to {0}"
|
||||
msgstr "无法复制种子文件到{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:355
|
||||
#, java-format
|
||||
msgid "from {0}"
|
||||
msgstr "来源{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:363
|
||||
#, java-format
|
||||
msgid "Fetching {0}"
|
||||
msgstr "正在获取{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:367
|
||||
msgid "Invalid URL - must start with http://"
|
||||
msgstr "无效链接 - 必须以http:// 开头"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:397
|
||||
#, java-format
|
||||
msgid "Starting up torrent {0}"
|
||||
msgstr "正在启动种子{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:417
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:435
|
||||
#, java-format
|
||||
msgid "Torrent file deleted: {0}"
|
||||
msgstr "种子文件已删除:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:441
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:451
|
||||
#, java-format
|
||||
msgid "Data file deleted: {0}"
|
||||
msgstr "数据文件已删除:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:443
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:453
|
||||
#, java-format
|
||||
msgid "Data file could not be deleted: {0}"
|
||||
msgstr "无法删除数据文件:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:462
|
||||
#, java-format
|
||||
msgid "Data dir deleted: {0}"
|
||||
msgstr "数据文件夹已删除:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:494
|
||||
msgid "Error creating torrent - you must select a tracker"
|
||||
msgstr "创建种子时发生错误 - 您必须选择一个Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:509
|
||||
#, java-format
|
||||
msgid "Torrent created for \"{0}\""
|
||||
msgstr "种子创建成功\"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:512
|
||||
#, java-format
|
||||
msgid "Many I2P trackers require you to register new torrents before seeding - please do so before starting \"{0}\""
|
||||
msgstr "多数I2PTracker需要用户在做种前注册新种子 - 请在启动 \"{0}\"前到所使用的Tracker进行注册。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:514
|
||||
#, java-format
|
||||
msgid "Error creating a torrent for \"{0}\""
|
||||
msgstr "创建种子时发生错误 \"{0}\""
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:517
|
||||
#, java-format
|
||||
msgid "Cannot create a torrent for the nonexistent data: {0}"
|
||||
msgstr "无法为不存在的数据文件创建种子:{0}"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:520
|
||||
msgid "Error creating torrent - you must enter a file or directory"
|
||||
msgstr "创建种子时发生错误 - 必须指定文件或文件夹"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:523
|
||||
msgid "Stopping all torrents and closing the I2P tunnel."
|
||||
msgstr "正在停用所有种子并关闭I2P隧道。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:532
|
||||
msgid "I2P tunnel closed."
|
||||
msgstr "I2P隧道已关闭"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:535
|
||||
msgid "Opening the I2P tunnel and starting all torrents."
|
||||
msgstr "正在打开I2P隧道并启动所有种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:657
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:851
|
||||
msgid "Unknown"
|
||||
msgstr "未知"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:660
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:665
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:670
|
||||
msgid "TrackerErr"
|
||||
msgstr "Tracker错误"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:663
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:666
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:677
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:680
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:688
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:691
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:696
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:699
|
||||
#, java-format
|
||||
msgid "1 peer"
|
||||
msgid_plural "{0} peers"
|
||||
msgstr[0] "{0}个用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:674
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:679
|
||||
msgid "Seeding"
|
||||
msgstr "正做种"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:682
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1327
|
||||
msgid "Complete"
|
||||
msgstr "完成"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:685
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:690
|
||||
msgid "OK"
|
||||
msgstr "确定"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:693
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:698
|
||||
msgid "Stalled"
|
||||
msgstr "等待"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:701
|
||||
msgid "No Peers"
|
||||
msgstr "没有用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:703
|
||||
msgid "Stopped"
|
||||
msgstr "已停用"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:718
|
||||
msgid "View files"
|
||||
msgstr "浏览文件"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:720
|
||||
msgid "Open file"
|
||||
msgstr "打开文件"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:750
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:967
|
||||
msgid "Tracker"
|
||||
msgstr "Tracker服务器"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:751
|
||||
msgid "Details"
|
||||
msgstr "详情"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:785
|
||||
msgid "Stop the torrent"
|
||||
msgstr "停止种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:787
|
||||
msgid "Stop"
|
||||
msgstr "停止"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:793
|
||||
msgid "Start the torrent"
|
||||
msgstr "启动种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:795
|
||||
msgid "Start"
|
||||
msgstr "启动"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:800
|
||||
msgid "Remove the torrent from the active list, deleting the .torrent file"
|
||||
msgstr "取消下载任务并删除对应种子文件。"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:805
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the file \\''{0}.torrent\\'' (downloaded data will not be deleted) ?"
|
||||
msgstr "您确定要删除文件“{0}.torrent”(下载的数据文件不会被删除)?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:807
|
||||
msgid "Remove"
|
||||
msgstr "移除"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:811
|
||||
msgid "Delete the .torrent file and the associated data file(s)"
|
||||
msgstr "删除种子及所下载的文件"
|
||||
|
||||
#. Can't figure out how to escape double quotes inside the onclick string.
|
||||
#. Single quotes in translate strings with parameters must be doubled.
|
||||
#. Then the remaining single quite must be escaped
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:816
|
||||
#, java-format
|
||||
msgid "Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded data?"
|
||||
msgstr "您确定要删除种子“{0}”(下载的数据文件会一并被删除)?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:818
|
||||
msgid "Delete"
|
||||
msgstr "删除"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:861
|
||||
msgid "Seed"
|
||||
msgstr "种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:879
|
||||
msgid "Uninteresting (The peer has no pieces we need)"
|
||||
msgstr "无需要部分"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:881
|
||||
msgid "Choked (The peer is not allowing us to request pieces)"
|
||||
msgstr "拒绝请求"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:895
|
||||
msgid "Uninterested (We have no pieces the peer needs)"
|
||||
msgstr "无需要部分"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:897
|
||||
msgid "Choking (We are not allowing the peer to request pieces)"
|
||||
msgstr "拒绝请求"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:927
|
||||
msgid "Add Torrent"
|
||||
msgstr "添加种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:929
|
||||
msgid "From URL"
|
||||
msgstr "从URL"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:934
|
||||
msgid "Add torrent"
|
||||
msgstr "添加种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:937
|
||||
#, java-format
|
||||
msgid "Alternately, you can copy .torrent files to the directory {0}."
|
||||
msgstr "或者您可以将.torrent文件复制到以下目录{0}."
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:939
|
||||
msgid "Removing a .torrent file will cause the torrent to stop."
|
||||
msgstr "删除种子文件将导致中止该下载任务。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:958
|
||||
msgid "Create Torrent"
|
||||
msgstr "创建种子"
|
||||
|
||||
#. out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n");
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:961
|
||||
msgid "Data to seed"
|
||||
msgstr "做种数据"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:965
|
||||
msgid "File or directory to seed (must be within the specified path)"
|
||||
msgstr "做种文件或文件夹(必须下面为Snark指定的文件夹中)"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:969
|
||||
msgid "Select a tracker"
|
||||
msgstr "选择一个Tracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:982
|
||||
msgid "or"
|
||||
msgstr "或"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:985
|
||||
msgid "Specify custom tracker announce URL"
|
||||
msgstr "指定Open Tracker发布链接"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:988
|
||||
msgid "Create torrent"
|
||||
msgstr "创建种子"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1006
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1133
|
||||
msgid "Configuration"
|
||||
msgstr "设置"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1009
|
||||
msgid "Data directory"
|
||||
msgstr "数据文件夹"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1012
|
||||
msgid "Directory to store torrents and data"
|
||||
msgstr "种子及被做种文件的保存位置。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1014
|
||||
msgid "Edit i2psnark.config and restart to change"
|
||||
msgstr "编辑 i2psnark.config 并重启Snark后生效"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1018
|
||||
msgid "Auto start"
|
||||
msgstr "自动启动"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1022
|
||||
msgid "If checked, automatically start torrents that are added"
|
||||
msgstr "选中后Snark将自动启动已添加的所有种子。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1026
|
||||
msgid "Startup delay"
|
||||
msgstr "启动延迟"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1028
|
||||
msgid "minutes"
|
||||
msgstr "分"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1052
|
||||
msgid "Total uploader limit"
|
||||
msgstr "限制总上传种子数为"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1055
|
||||
msgid "peers"
|
||||
msgstr "用户"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1059
|
||||
msgid "Up bandwidth limit"
|
||||
msgstr "上传带宽限制"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1062
|
||||
msgid "Half available bandwidth recommended."
|
||||
msgstr "推荐设置为可用带宽的一半。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1064
|
||||
msgid "View or change router bandwidth"
|
||||
msgstr "浏览或修改路由器带宽"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1068
|
||||
msgid "Use open trackers also"
|
||||
msgstr "同时使用OpenTracker"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1072
|
||||
msgid "If checked, announce torrents to open trackers as well as the tracker listed in the torrent file"
|
||||
msgstr "选择后在OpenTracker及种子文件中的Tracker上同时发布。"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1076
|
||||
msgid "Open tracker announce URLs"
|
||||
msgstr "Open Tracker发布链接"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1088
|
||||
msgid "Inbound Settings"
|
||||
msgstr "入站设置"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1094
|
||||
msgid "Outbound Settings"
|
||||
msgstr "出站设置"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1101
|
||||
msgid "I2CP host"
|
||||
msgstr "I2CP主机"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1106
|
||||
msgid "I2CP port"
|
||||
msgstr "I2CP端口"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1118
|
||||
msgid "I2CP options"
|
||||
msgstr "I2CP选项"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1124
|
||||
msgid "Save configuration"
|
||||
msgstr "保存设置"
|
||||
|
||||
#. * dummies for translation
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1141
|
||||
#, java-format
|
||||
msgid "1 hop"
|
||||
msgid_plural "{0} hops"
|
||||
msgstr[0] "{0}跳"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1142
|
||||
#, java-format
|
||||
msgid "1 tunnel"
|
||||
msgid_plural "{0} tunnels"
|
||||
msgstr[0] "{0}隧道"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1283
|
||||
msgid "Up to higher level directory"
|
||||
msgstr "上一层文件夹"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "File"
|
||||
msgstr "文件"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1288
|
||||
msgid "Size"
|
||||
msgstr "大小"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1311
|
||||
msgid "Directory"
|
||||
msgstr "文件夹"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1316
|
||||
msgid "Torrent not found?"
|
||||
msgstr "种子未找到"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1324
|
||||
msgid "File not found in torrent?"
|
||||
msgstr "种子中没有发现文件?"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1330
|
||||
msgid "complete"
|
||||
msgstr "完成"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1331
|
||||
msgid "bytes remaining"
|
||||
msgstr "剩余字节数"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1456
|
||||
#, java-format
|
||||
msgid "Torrent fetched from {0}"
|
||||
msgstr "从{0}获取种子成功"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1484
|
||||
#, java-format
|
||||
msgid "Torrent at {0} was not valid"
|
||||
msgstr "{0}的种子中有错误"
|
||||
|
||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1489
|
||||
#, java-format
|
||||
msgid "Torrent was not retrieved from {0}"
|
||||
msgstr "从{0}获得种子失败"
|
||||
|
||||
#~ msgid "Cannot change the I2CP settings while torrents are active"
|
||||
#~ msgstr "正在下载/上传,无法更改I2CP设置"
|
||||
#~ msgid "{0} torrents"
|
||||
#~ msgstr "{0} 个种子"
|
||||
#~ msgid "Non-i2p tracker in \"{0}\", deleting it from our list of trackers!"
|
||||
#~ msgstr ""
|
||||
#~ "【匿名性警告】\"{0}\" 中含有非I2P Tracker,程序将从Tracker列表中将其删除。"
|
||||
#~ msgid "Custom tracker URL"
|
||||
#~ msgstr "自定义TrackerURL"
|
||||
#~ msgid "Configure"
|
||||
#~ msgstr "设置"
|
||||
|
17
apps/i2ptunnel/java/bmsg.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Update messages_xx.po and messages_xx.class files,
|
||||
# from both java and jsp sources.
|
||||
# Requires installed programs xgettext, msgfmt, msgmerge, and find.
|
||||
# zzz - public domain
|
||||
#
|
||||
|
||||
## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\
|
||||
## need to cd into our orignal path - where we call sh.exe from.
|
||||
|
||||
cd $CALLFROM
|
||||
## echo $PWD
|
||||
|
||||
## except this everything is the same with bundle-message.sh
|
||||
## walking - public domain :-D
|
||||
|
||||
source bundle-messages.sh $PARAS
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project basedir="." default="all" name="i2ptunnel">
|
||||
<target name="all" depends="clean, build" />
|
||||
<target name="build" depends="builddep, jar" />
|
||||
<target name="build" depends="builddep, jar, war" />
|
||||
<target name="builddep">
|
||||
<ant dir="../../ministreaming/java/" target="build" />
|
||||
<ant dir="../../jetty/" target="build" />
|
||||
@ -34,6 +34,10 @@
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- TODO: Move the web classes from the jar to the war - they are not part of the API
|
||||
- This will require sponge to rewrite some seedless stuff that uses it.
|
||||
-->
|
||||
<target name="jar" depends="builddep, compile">
|
||||
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class">
|
||||
<manifest>
|
||||
@ -41,14 +45,47 @@
|
||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
|
||||
</manifest>
|
||||
</jar>
|
||||
<ant target="war" />
|
||||
</target>
|
||||
<target name="war" depends="precompilejsp">
|
||||
|
||||
<target name="bundle" depends="compile, precompilejsp">
|
||||
<!-- Update the messages_*.po files.
|
||||
We need to supply the bat file for windows, and then change the fail property to true -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
</exec>
|
||||
<exec executable="sh" osfamily="mac" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
</exec>
|
||||
<exec executable="cmd" osfamily="windows" failifexecutionfails="false" >
|
||||
<arg value="/c" />
|
||||
<arg value="bundle-messages.bat" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="poupdate" depends="compile, precompilejsp">
|
||||
<!-- Update the messages_*.po files. -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
<exec executable="cmd" osfamily="windows" failifexecutionfails="true" >
|
||||
<arg value="/c" />
|
||||
<arg value="bundle-messages.bat" />
|
||||
<arg value="-p" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="war" depends="precompilejsp, bundle">
|
||||
<war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
|
||||
basedir="../jsp/" excludes="web.xml, **/*.java, *.jsp">
|
||||
</war>
|
||||
</target>
|
||||
<target name="precompilejsp" unless="precompilejsp.uptodate">
|
||||
|
||||
<target name="precompilejsp" depends="jar" unless="precompilejsp.uptodate">
|
||||
<delete dir="../jsp/WEB-INF/" />
|
||||
<delete file="../jsp/web-fragment.xml" />
|
||||
<delete file="../jsp/web-out.xml" />
|
||||
@ -113,11 +150,7 @@
|
||||
<delete file="../jsp/web-out.xml" />
|
||||
</target>
|
||||
<target name="cleandep" depends="clean">
|
||||
<!-- ministreaming will clean core -->
|
||||
<ant dir="../../ministreaming/java/" target="distclean" />
|
||||
</target>
|
||||
<target name="distclean" depends="clean">
|
||||
<!-- ministreaming will clean core -->
|
||||
<ant dir="../../ministreaming/java/" target="distclean" />
|
||||
</target>
|
||||
</project>
|
||||
|
26
apps/i2ptunnel/java/bundle-messages.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
set Callfrom=%cd%
|
||||
set Paras=%1
|
||||
|
||||
rem before calling make sure you have msys and mingw 's "bin" path
|
||||
rem in your current searching path
|
||||
rem type "set path" to check
|
||||
if not exist ..\locale\*.only goto updateALL
|
||||
|
||||
rem put a messages_xx.only(eg messages_zh.only) into locale folder
|
||||
rem this script will only touch the po file(eg zh) you specified, leaving other po files untact.
|
||||
|
||||
for %%i in (..\locale\*.only) do set PO=%%~ni
|
||||
echo [Notice] Yu choose to Ony update the choosen file: %PO%.po
|
||||
for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po-
|
||||
|
||||
call sh --login %cd%\bmsg.sh
|
||||
|
||||
for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po
|
||||
goto end
|
||||
|
||||
:updateALL
|
||||
call sh --login %cd%\bmsg.sh
|
||||
|
||||
:end
|
||||
echo End of Message Bundling
|
87
apps/i2ptunnel/java/bundle-messages.sh
Executable file
@ -0,0 +1,87 @@
|
||||
#
|
||||
# Update messages_xx.po and messages_xx.class files,
|
||||
# from both java and jsp sources.
|
||||
# Requires installed programs xgettext, msgfmt, msgmerge, and find.
|
||||
#
|
||||
# usage:
|
||||
# bundle-messages.sh (generates the resource bundle from the .po file)
|
||||
# bundle-messages.sh -p (updates the .po file from the source tags, then generates the resource bundle)
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
CLASS=net.i2p.i2ptunnel.web.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
if [ "$1" = "-p" ]
|
||||
then
|
||||
POUPDATE=1
|
||||
fi
|
||||
|
||||
# add ../java/ so the refs will work in the po file
|
||||
JPATHS="../java/src ../jsp/WEB-INF"
|
||||
for i in ../locale/messages_*.po
|
||||
do
|
||||
# get language
|
||||
LG=${i#../locale/messages_}
|
||||
LG=${LG%.po}
|
||||
|
||||
if [ "$POUPDATE" = "1" ]
|
||||
then
|
||||
# make list of java files newer than the .po file
|
||||
find $JPATHS -name *.java -newer $i > $TMPFILE
|
||||
fi
|
||||
if [ -s ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web/messages_$LG.class -a \
|
||||
../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web/messages_$LG.class -nt $i -a \
|
||||
! -s $TMPFILE ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$POUPDATE" = "1" ]
|
||||
then
|
||||
echo "Updating the $i file from the tags..."
|
||||
# extract strings from java and jsp files, and update messages.po files
|
||||
# translate calls must be one of the forms:
|
||||
# _("foo")
|
||||
# _x("foo")
|
||||
# intl._("foo")
|
||||
# intl.title("foo")
|
||||
# In a jsp, you must use a helper or handler that has the context set.
|
||||
# To start a new translation, copy the header from an old translation to the new .po file,
|
||||
# then ant distclean updater.
|
||||
find $JPATHS -name *.java > $TMPFILE
|
||||
xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\
|
||||
--keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
|
||||
-o ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - xgettext failed, not updating translations'
|
||||
rm -f ${i}t
|
||||
break
|
||||
fi
|
||||
msgmerge -U --backup=none $i ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - msgmerge failed, not updating translations'
|
||||
rm -f ${i}t
|
||||
break
|
||||
fi
|
||||
rm -f ${i}t
|
||||
# so we don't do this again
|
||||
touch $i
|
||||
fi
|
||||
|
||||
echo "Generating ${CLASS}_$LG ResourceBundle..."
|
||||
|
||||
# convert to class files in build/obj
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Warning - msgfmt failed, not updating translations'
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f $TMPFILE
|
||||
# todo: return failure
|
||||
exit 0
|
@ -1,72 +0,0 @@
|
||||
/* I2PTunnel is GPL'ed (with the exception mentioned in I2PTunnel.java)
|
||||
* (c) 2003 - 2004 mihi
|
||||
*/
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Read what i2ptunnel logs, and expose it in a buffer
|
||||
*
|
||||
*/
|
||||
class BufferLogger implements Logging {
|
||||
private final static Log _log = new Log(BufferLogger.class);
|
||||
private ByteArrayOutputStream _baos; // FIXME should be final and use a factory. FIXME
|
||||
private boolean _ignore;
|
||||
|
||||
/**
|
||||
* Constructs a buffered logger.
|
||||
*/
|
||||
public BufferLogger() {
|
||||
_baos = new ByteArrayOutputStream(512);
|
||||
_ignore = false;
|
||||
}
|
||||
|
||||
private final static String EMPTY = "";
|
||||
|
||||
/**
|
||||
* Retrieves the buffer
|
||||
* @return the buffer
|
||||
*/
|
||||
public String getBuffer() {
|
||||
if (_ignore)
|
||||
return EMPTY;
|
||||
|
||||
return new String(_baos.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* We don't care about anything else the logger receives. This is useful
|
||||
* for loggers passed in to servers and clients, since they will continue
|
||||
* to add info to the logger, but if we're instantiated by the tunnel manager,
|
||||
* its likely we only care about the first few messages it sends us.
|
||||
*
|
||||
*/
|
||||
public void ignoreFurtherActions() {
|
||||
_ignore = true;
|
||||
synchronized (_baos) {
|
||||
_baos.reset();
|
||||
}
|
||||
_baos = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in some random data
|
||||
* @param s String containing what we're logging.
|
||||
*/
|
||||
public void log(String s) {
|
||||
if (_ignore) return;
|
||||
if (s != null) {
|
||||
_log.debug("logging [" + s + "]");
|
||||
try {
|
||||
_baos.write(s.getBytes());
|
||||
_baos.write('\n');
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Error logging [" + s + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ import java.util.zip.GZIPInputStream;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.ByteArray;
|
||||
import net.i2p.util.ByteCache;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
@ -124,13 +124,13 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
* Tweak that first HTTP response line (HTTP 200 OK, etc)
|
||||
*
|
||||
*/
|
||||
protected String filterResponseLine(String line) {
|
||||
protected static String filterResponseLine(String line) {
|
||||
return line;
|
||||
}
|
||||
|
||||
/** we ignore any potential \r, since we trim it on write anyway */
|
||||
private static final byte NL = '\n';
|
||||
private boolean isNL(byte b) { return (b == NL); }
|
||||
private static boolean isNL(byte b) { return (b == NL); }
|
||||
|
||||
/** ok, received, now munge & write it */
|
||||
private void writeHeader() throws IOException {
|
||||
@ -219,7 +219,7 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
//out.flush();
|
||||
PipedInputStream pi = new PipedInputStream();
|
||||
PipedOutputStream po = new PipedOutputStream(pi);
|
||||
new I2PThread(new Pusher(pi, out), "HTTP decompresser").start();
|
||||
new I2PAppThread(new Pusher(pi, out), "HTTP decompresser").start();
|
||||
out = po;
|
||||
}
|
||||
|
||||
@ -275,7 +275,8 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
_context.statManager().addRateData("i2ptunnel.httpExpanded", (long)expanded, end-start);
|
||||
}
|
||||
}
|
||||
private class InternalGZIPInputStream extends GZIPInputStream {
|
||||
|
||||
private static class InternalGZIPInputStream extends GZIPInputStream {
|
||||
public InternalGZIPInputStream(InputStream in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
@ -318,6 +319,7 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
return super.toString() + ": " + _in;
|
||||
}
|
||||
|
||||
/*******
|
||||
public static void main(String args[]) {
|
||||
String simple = "HTTP/1.1 200 OK\n" +
|
||||
"foo: bar\n" +
|
||||
@ -367,7 +369,6 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
"A:\n" +
|
||||
"\n";
|
||||
|
||||
/* */
|
||||
test("Simple", simple, true);
|
||||
test("Filtered", filtered, true);
|
||||
test("Filtered windows", winfilter, true);
|
||||
@ -382,7 +383,6 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
test("Invalid (bad headers)", invalid5, true);
|
||||
test("Invalid (bad headers2)", invalid6, false);
|
||||
test("Invalid (bad headers3)", invalid7, false);
|
||||
/* */
|
||||
}
|
||||
|
||||
private static void test(String name, String orig, boolean shouldPass) {
|
||||
@ -401,4 +401,5 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
System.out.println("Properly fails with " + e.getMessage());
|
||||
}
|
||||
}
|
||||
******/
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ import net.i2p.data.Base64;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.i2ptunnel.socks.I2PSOCKSIRCTunnel;
|
||||
import net.i2p.i2ptunnel.socks.I2PSOCKSTunnel;
|
||||
import net.i2p.i2ptunnel.streamr.StreamrConsumer;
|
||||
import net.i2p.i2ptunnel.streamr.StreamrProducer;
|
||||
@ -68,6 +69,9 @@ import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.EventDispatcherImpl;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Todo: Most events are not listened to elsewhere, so error propagation is poor
|
||||
*/
|
||||
public class I2PTunnel implements Logging, EventDispatcher {
|
||||
private Log _log;
|
||||
private EventDispatcherImpl _event;
|
||||
@ -162,7 +166,12 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
System.out.print("I2PTunnel>");
|
||||
String cmd = r.readLine();
|
||||
if (cmd == null) break;
|
||||
if (cmd.length() <= 0) continue;
|
||||
try {
|
||||
runCommand(cmd, this);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
@ -179,6 +188,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return non-null */
|
||||
List<I2PSession> getSessions() {
|
||||
synchronized (_sessions) {
|
||||
return new ArrayList(_sessions);
|
||||
@ -236,6 +246,8 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
runServer(args, l);
|
||||
} else if ("httpserver".equals(cmdname)) {
|
||||
runHttpServer(args, l);
|
||||
} else if ("httpbidirserver".equals(cmdname)) {
|
||||
runHttpBidirServer(args, l);
|
||||
} else if ("ircserver".equals(cmdname)) {
|
||||
runIrcServer(args, l);
|
||||
} else if ("textserver".equals(cmdname)) {
|
||||
@ -300,6 +312,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("ping <args>");
|
||||
l.log("server <host> <port> <privkeyfile>");
|
||||
l.log("httpserver <host> <port> <spoofedhost> <privkeyfile>");
|
||||
l.log("httpbidirserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>");
|
||||
l.log("textserver <host> <port> <privkey>");
|
||||
l.log("genkeys <privkeyfile> [<pubkeyfile>]");
|
||||
l.log("gentextkeys");
|
||||
@ -347,6 +360,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {hostname, portNumber, privKeyFilename}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runServer(String args[], Logging l) {
|
||||
if (args.length == 3) {
|
||||
@ -359,7 +373,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("unknown host");
|
||||
_log.error(getPrefix() + "Error resolving " + args[0], uhe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Error resolving " + args[0] + uhe.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
@ -368,17 +382,18 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[1], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[1]);
|
||||
|
||||
privKeyFile = new File(args[2]);
|
||||
if (!privKeyFile.isAbsolute())
|
||||
privKeyFile = new File(_context.getConfigDir(), args[2]);
|
||||
if (!privKeyFile.canRead()) {
|
||||
l.log("private key file does not exist");
|
||||
l.log(getPrefix() + "Private key file does not exist or is not readable: " + args[2]);
|
||||
_log.error(getPrefix() + "Private key file does not exist or is not readable: " + args[2]);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Cannot open private key file " + args[2]);
|
||||
}
|
||||
I2PTunnelServer serv = new I2PTunnelServer(serverHost, portNum, privKeyFile, args[2], l, (EventDispatcher) this, this);
|
||||
serv.setReadTimeout(readTimeout);
|
||||
@ -396,6 +411,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
/**
|
||||
* Same args as runServer
|
||||
* (we should stop duplicating all this code...)
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runIrcServer(String args[], Logging l) {
|
||||
if (args.length == 3) {
|
||||
@ -408,7 +424,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("unknown host");
|
||||
_log.error(getPrefix() + "Error resolving " + args[0], uhe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Error resolving " + args[0] + uhe.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
@ -417,17 +433,18 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[1], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[1]);
|
||||
|
||||
privKeyFile = new File(args[2]);
|
||||
if (!privKeyFile.isAbsolute())
|
||||
privKeyFile = new File(_context.getConfigDir(), args[2]);
|
||||
if (!privKeyFile.canRead()) {
|
||||
l.log("private key file does not exist");
|
||||
l.log(getPrefix() + "Private key file does not exist or is not readable: " + args[2]);
|
||||
_log.error(getPrefix() + "Private key file does not exist or is not readable: " + args[2]);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Cannot open private key file " + args[2]);
|
||||
}
|
||||
I2PTunnelServer serv = new I2PTunnelIRCServer(serverHost, portNum, privKeyFile, args[2], l, (EventDispatcher) this, this);
|
||||
serv.setReadTimeout(readTimeout);
|
||||
@ -453,6 +470,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {hostname, portNumber, spoofedHost, privKeyFilename}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runHttpServer(String args[], Logging l) {
|
||||
if (args.length == 4) {
|
||||
@ -465,7 +483,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("unknown host");
|
||||
_log.error(getPrefix() + "Error resolving " + args[0], uhe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Error resolving " + args[0] + uhe.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
@ -474,8 +492,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[1], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[1]);
|
||||
|
||||
String spoofedHost = args[2];
|
||||
|
||||
@ -483,10 +502,10 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
if (!privKeyFile.isAbsolute())
|
||||
privKeyFile = new File(_context.getConfigDir(), args[3]);
|
||||
if (!privKeyFile.canRead()) {
|
||||
l.log("private key file does not exist");
|
||||
l.log(getPrefix() + "Private key file does not exist or is not readable: " + args[3]);
|
||||
_log.error(getPrefix() + "Private key file does not exist or is not readable: " + args[3]);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Cannot open private key file " + args[3]);
|
||||
}
|
||||
I2PTunnelHTTPServer serv = new I2PTunnelHTTPServer(serverHost, portNum, privKeyFile, args[3], spoofedHost, l, (EventDispatcher) this, this);
|
||||
serv.setReadTimeout(readTimeout);
|
||||
@ -503,16 +522,97 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the HTTP server pointing at the host and port specified using the private i2p
|
||||
* destination loaded from the specified file, replacing the HTTP headers
|
||||
* so that the Host: specified is the one spoofed. Also runs an HTTP proxy for
|
||||
* bidirectional communications on the same tunnel destination.<p />
|
||||
*
|
||||
* Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error)
|
||||
* Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after
|
||||
* 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
|
||||
*
|
||||
* @param args {hostname, portNumber, proxyPortNumber, spoofedHost, privKeyFilename}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runHttpBidirServer(String args[], Logging l) {
|
||||
if (args.length == 5) {
|
||||
InetAddress serverHost = null;
|
||||
int portNum = -1;
|
||||
int port2Num = -1;
|
||||
File privKeyFile = null;
|
||||
try {
|
||||
serverHost = InetAddress.getByName(args[0]);
|
||||
} catch (UnknownHostException uhe) {
|
||||
l.log("unknown host");
|
||||
_log.error(getPrefix() + "Error resolving " + args[0], uhe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
throw new IllegalArgumentException(getPrefix() + "Error resolving " + args[0] + uhe.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
portNum = Integer.parseInt(args[1]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[1], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
|
||||
try {
|
||||
port2Num = Integer.parseInt(args[2]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[2], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[1]);
|
||||
if (port2Num <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[2]);
|
||||
|
||||
String spoofedHost = args[3];
|
||||
|
||||
privKeyFile = new File(args[4]);
|
||||
if (!privKeyFile.isAbsolute())
|
||||
privKeyFile = new File(_context.getConfigDir(), args[4]);
|
||||
if (!privKeyFile.canRead()) {
|
||||
l.log(getPrefix() + "Private key file does not exist or is not readable: " + args[4]);
|
||||
_log.error(getPrefix() + "Private key file does not exist or is not readable: " + args[4]);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
throw new IllegalArgumentException(getPrefix() + "Cannot open private key file " + args[4]);
|
||||
}
|
||||
|
||||
I2PTunnelHTTPBidirServer serv = new I2PTunnelHTTPBidirServer(serverHost, portNum, port2Num, privKeyFile, args[3], spoofedHost, l, (EventDispatcher) this, this);
|
||||
serv.setReadTimeout(readTimeout);
|
||||
serv.startRunning();
|
||||
addtask(serv);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(serv.getId()));
|
||||
return;
|
||||
} else {
|
||||
l.log("httpserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>");
|
||||
l.log(" creates a bidirectional HTTP server that sends all incoming data\n"
|
||||
+ " of its destination to host:port., filtering the HTTP\n"
|
||||
+ " headers so it looks like the request is to the spoofed host,"
|
||||
+ " and listens to host:proxyport to proxy HTTP requests.");
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the server pointing at the host and port specified using the private i2p
|
||||
* destination loaded from the given base64 stream. <p />
|
||||
*
|
||||
* Deprecated? Why run a server with a private destination?
|
||||
* Not available from the war GUI
|
||||
*
|
||||
* Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error)
|
||||
* Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after
|
||||
* 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
|
||||
*
|
||||
* @param args {hostname, portNumber, privKeyBase64}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runTextServer(String args[], Logging l) {
|
||||
if (args.length == 3) {
|
||||
@ -524,7 +624,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("unknown host");
|
||||
_log.error(getPrefix() + "Error resolving " + args[0], uhe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
throw new IllegalArgumentException(getPrefix() + "Error resolving " + args[0] + uhe.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
@ -533,8 +633,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[1], nfe);
|
||||
notifyEvent("serverTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[1]);
|
||||
|
||||
I2PTunnelServer serv = new I2PTunnelServer(serverHost, portNum, args[2], l, (EventDispatcher) this, this);
|
||||
serv.setReadTimeout(readTimeout);
|
||||
@ -560,6 +661,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {portNumber, destinationBase64 or "file:filename"[, sharedClient [, privKeyFile]]}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runClient(String args[], Logging l) {
|
||||
boolean isShared = true;
|
||||
@ -573,8 +675,10 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("clientTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (portNum <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
I2PTunnelTask task;
|
||||
ownDest = !isShared;
|
||||
try {
|
||||
@ -588,6 +692,11 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
_log.error(getPrefix() + "Invalid I2PTunnel config to create a client [" + host + ":"+ port + "]", iae);
|
||||
l.log("Invalid I2PTunnel configuration [" + host + ":" + port + "]");
|
||||
notifyEvent("clientTaskId", Integer.valueOf(-1));
|
||||
// Since nothing listens to TaskID events, use this to propagate the error to TunnelController
|
||||
// Otherwise, the tunnel stays up even though the port is down
|
||||
// This doesn't work for CLI though... and the tunnel doesn't close itself after error,
|
||||
// so this probably leaves the tunnel open if called from the CLI
|
||||
throw iae;
|
||||
}
|
||||
} else {
|
||||
l.log("client <port> <pubkey>[,<pubkey>]|file:<pubkeyfile>[ <sharedClient>] [<privKeyFile>]");
|
||||
@ -609,6 +718,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {portNumber[, sharedClient][, proxy to be used for the WWW]}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runHttpClient(String args[], Logging l) {
|
||||
if (args.length >= 1 && args.length <= 3) {
|
||||
@ -619,8 +729,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("httpclientTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (clientPort <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
String proxy = "";
|
||||
boolean isShared = true;
|
||||
@ -655,6 +766,11 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
_log.error(getPrefix() + "Invalid I2PTunnel config to create an httpclient [" + host + ":"+ clientPort + "]", iae);
|
||||
l.log("Invalid I2PTunnel configuration [" + host + ":" + clientPort + "]");
|
||||
notifyEvent("httpclientTaskId", Integer.valueOf(-1));
|
||||
// Since nothing listens to TaskID events, use this to propagate the error to TunnelController
|
||||
// Otherwise, the tunnel stays up even though the port is down
|
||||
// This doesn't work for CLI though... and the tunnel doesn't close itself after error,
|
||||
// so this probably leaves the tunnel open if called from the CLI
|
||||
throw iae;
|
||||
}
|
||||
} else {
|
||||
l.log("httpclient <port> [<sharedClient>] [<proxy>]");
|
||||
@ -671,6 +787,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {portNumber[, sharedClient][, proxy to be used for the WWW]}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runConnectClient(String args[], Logging l) {
|
||||
if (args.length >= 1 && args.length <= 3) {
|
||||
@ -679,8 +796,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
_port = Integer.parseInt(args[0]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
return;
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
String proxy = "";
|
||||
boolean isShared = true;
|
||||
@ -711,7 +829,12 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
task = new I2PTunnelConnectClient(_port, l, ownDest, proxy, (EventDispatcher) this, this);
|
||||
addtask(task);
|
||||
} catch (IllegalArgumentException iae) {
|
||||
_log.error(getPrefix() + "Invalid I2PTunnel config to create an httpclient [" + host + ":"+ _port + "]", iae);
|
||||
_log.error(getPrefix() + "Invalid I2PTunnel config to create a connect client [" + host + ":"+ _port + "]", iae);
|
||||
// Since nothing listens to TaskID events, use this to propagate the error to TunnelController
|
||||
// Otherwise, the tunnel stays up even though the port is down
|
||||
// This doesn't work for CLI though... and the tunnel doesn't close itself after error,
|
||||
// so this probably leaves the tunnel open if called from the CLI
|
||||
throw iae;
|
||||
}
|
||||
} else {
|
||||
l.log("connectclient <port> [<sharedClient>] [<proxy>]");
|
||||
@ -731,6 +854,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {portNumber,destinationBase64 or "file:filename" [, sharedClient [, privKeyFile]]}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runIrcClient(String args[], Logging l) {
|
||||
if (args.length >= 2) {
|
||||
@ -741,8 +865,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("ircclientTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
boolean isShared = true;
|
||||
if (args.length > 2) {
|
||||
@ -770,6 +895,11 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
_log.error(getPrefix() + "Invalid I2PTunnel config to create an ircclient [" + host + ":"+ _port + "]", iae);
|
||||
l.log("Invalid I2PTunnel configuration [" + host + ":" + _port + "]");
|
||||
notifyEvent("ircclientTaskId", Integer.valueOf(-1));
|
||||
// Since nothing listens to TaskID events, use this to propagate the error to TunnelController
|
||||
// Otherwise, the tunnel stays up even though the port is down
|
||||
// This doesn't work for CLI though... and the tunnel doesn't close itself after error,
|
||||
// so this probably leaves the tunnel open if called from the CLI
|
||||
throw iae;
|
||||
}
|
||||
} else {
|
||||
l.log("ircclient <port> [<sharedClient> [<privKeyFile>]]");
|
||||
@ -789,6 +919,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {portNumber [, sharedClient]}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runSOCKSTunnel(String args[], Logging l) {
|
||||
if (args.length >= 1 && args.length <= 2) {
|
||||
@ -799,8 +930,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
boolean isShared = false;
|
||||
if (args.length > 1)
|
||||
@ -808,7 +940,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
|
||||
ownDest = !isShared;
|
||||
I2PTunnelTask task;
|
||||
task = new I2PSOCKSTunnel(_port, l, ownDest, (EventDispatcher) this, this);
|
||||
task = new I2PSOCKSTunnel(_port, l, ownDest, (EventDispatcher) this, this, null);
|
||||
addtask(task);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(task.getId()));
|
||||
} else {
|
||||
@ -818,11 +950,51 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run an SOCKS IRC tunnel on the given port number
|
||||
* @param args {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)
|
||||
* @throws IllegalArgumentException on config problem
|
||||
* @since 0.7.12
|
||||
*/
|
||||
public void runSOCKSIRCTunnel(String args[], Logging l) {
|
||||
if (args.length >= 1 && args.length <= 3) {
|
||||
int _port = -1;
|
||||
try {
|
||||
_port = Integer.parseInt(args[0]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
boolean isShared = false;
|
||||
if (args.length == 2)
|
||||
isShared = "true".equalsIgnoreCase(args[1].trim());
|
||||
|
||||
ownDest = !isShared;
|
||||
String privateKeyFile = null;
|
||||
if (args.length == 3)
|
||||
privateKeyFile = args[2];
|
||||
I2PTunnelTask task;
|
||||
task = new I2PSOCKSIRCTunnel(_port, l, ownDest, (EventDispatcher) this, this, privateKeyFile);
|
||||
addtask(task);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(task.getId()));
|
||||
} else {
|
||||
l.log("socksirctunnel <port> [<sharedClient> [<privKeyFile>]]");
|
||||
l.log(" creates a tunnel for SOCKS IRC.");
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Streamr client
|
||||
*
|
||||
* @param args {targethost, targetport, destinationString}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runStreamrClient(String args[], Logging l) {
|
||||
if (args.length == 3) {
|
||||
@ -843,8 +1015,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("streamrtunnelTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
StreamrConsumer task = new StreamrConsumer(_host, _port, args[2], l, (EventDispatcher) this, this);
|
||||
task.startRunning();
|
||||
@ -862,6 +1035,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
*
|
||||
* @param args {port, privkeyfile}
|
||||
* @param l logger to receive events and output
|
||||
* @throws IllegalArgumentException on config problem
|
||||
*/
|
||||
public void runStreamrServer(String args[], Logging l) {
|
||||
if (args.length == 2) {
|
||||
@ -872,8 +1046,9 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
l.log("invalid port");
|
||||
_log.error(getPrefix() + "Port specified is not valid: " + args[0], nfe);
|
||||
notifyEvent("streamrtunnelTaskId", Integer.valueOf(-1));
|
||||
return;
|
||||
}
|
||||
if (_port <= 0)
|
||||
throw new IllegalArgumentException(getPrefix() + "Bad port " + args[0]);
|
||||
|
||||
File privKeyFile = new File(args[1]);
|
||||
if (!privKeyFile.isAbsolute())
|
||||
@ -1414,7 +1589,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
private String getPrefix() { return '[' + _tunnelId + "]: "; }
|
||||
private String getPrefix() { return "[" + _tunnelId + "]: "; }
|
||||
|
||||
public I2PAppContext getContext() { return _context; }
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
|
||||
private static final Log _log = new Log(I2PTunnelClient.class);
|
||||
|
||||
/** list of Destination objects that we point at */
|
||||
protected List dests;
|
||||
protected List<Destination> dests;
|
||||
private static final long DEFAULT_READ_TIMEOUT = 5*60*1000; // -1
|
||||
protected long readTimeout = DEFAULT_READ_TIMEOUT;
|
||||
|
||||
@ -54,10 +54,21 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (dests.size() <= 0) {
|
||||
l.log("No target destinations found");
|
||||
if (dests.isEmpty()) {
|
||||
l.log("No valid target destinations found");
|
||||
notifyEvent("openClientResult", "error");
|
||||
return;
|
||||
// Nothing is listening for the above event, so it's useless
|
||||
// Maybe figure out where to put a waitEventValue("openClientResult") ??
|
||||
// In the meantime, let's do this the easy way
|
||||
// Note that b32 dests will often not be resolvable at instantiation time;
|
||||
// a delayed resolution system would be even better.
|
||||
|
||||
// Don't close() here, because it does a removeSession() and then
|
||||
// TunnelController can't acquire() it to release() it.
|
||||
//close(true);
|
||||
// Unfortunately, super() built the whole tunnel before we get here.
|
||||
throw new IllegalArgumentException("No valid target destinations found");
|
||||
//return;
|
||||
}
|
||||
|
||||
setName(getLocalPort() + " -> " + destinations);
|
||||
@ -78,8 +89,9 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
|
||||
i2ps.setReadTimeout(readTimeout);
|
||||
new I2PTunnelRunner(s, i2ps, sockLock, null, mySockets);
|
||||
} catch (Exception ex) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Error connecting", ex);
|
||||
l.log(ex.getMessage());
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
closeSocket(s);
|
||||
if (i2ps != null) {
|
||||
synchronized (sockLock) {
|
||||
@ -97,8 +109,8 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
|
||||
return null;
|
||||
}
|
||||
if (size == 1) // skip the rand in the most common case
|
||||
return (Destination)dests.get(0);
|
||||
return dests.get(0);
|
||||
int index = I2PAppContext.getGlobalContext().random().nextInt(size);
|
||||
return (Destination)dests.get(index);
|
||||
return dests.get(index);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import net.i2p.client.streaming.I2PSocketManagerFactory;
|
||||
import net.i2p.client.streaming.I2PSocketOptions;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
@ -67,7 +67,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
// private Object conLock = new Object();
|
||||
|
||||
/** List of Socket for those accept()ed but not yet started up */
|
||||
private List _waitingSockets = new ArrayList(); // FIXME should be final and use a factory. FIXME
|
||||
protected final List _waitingSockets = new ArrayList(4); // FIXME should be final and use a factory. FIXME
|
||||
/** How many connections will we allow to be in the process of being built at once? */
|
||||
private int _numConnectionBuilders;
|
||||
/** How long will we allow sockets to sit in the _waitingSockets map before killing them? */
|
||||
@ -90,11 +90,51 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
private static final int DEFAULT_NUM_CONNECTION_BUILDERS = 5;
|
||||
private static final int DEFAULT_MAX_WAIT_TIME = 30*1000;
|
||||
|
||||
//public I2PTunnelClientBase(int localPort, boolean ownDest,
|
||||
// Logging l) {
|
||||
// I2PTunnelClientBase(localPort, ownDest, l, (EventDispatcher)null);
|
||||
//}
|
||||
// true if we are chained from a server.
|
||||
private boolean chained = false;
|
||||
|
||||
public I2PTunnelClientBase(int localPort, Logging l, I2PSocketManager sktMgr,
|
||||
I2PTunnel tunnel, EventDispatcher notifyThis, long clientId )
|
||||
throws IllegalArgumentException {
|
||||
super(localPort + " (uninitialized)", notifyThis, tunnel);
|
||||
chained = true;
|
||||
sockMgr = sktMgr;
|
||||
_clientId = clientId;
|
||||
this.localPort = localPort;
|
||||
this.l = l;
|
||||
this.handlerName = handlerName + _clientId;
|
||||
_ownDest = true; // == ! shared client
|
||||
_context = tunnel.getContext();
|
||||
_context.statManager().createRateStat("i2ptunnel.client.closeBacklog", "How many pending sockets remain when we close one due to backlog?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
|
||||
_context.statManager().createRateStat("i2ptunnel.client.closeNoBacklog", "How many pending sockets remain when it was removed prior to backlog timeout?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
|
||||
_context.statManager().createRateStat("i2ptunnel.client.manageTime", "How long it takes to accept a socket and fire it into an i2ptunnel runner (or queue it for the pool)?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
|
||||
_context.statManager().createRateStat("i2ptunnel.client.buildRunTime", "How long it takes to run a queued socket into an i2ptunnel runner?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
|
||||
|
||||
Thread t = new I2PAppThread(this);
|
||||
t.setName("Client " + _clientId);
|
||||
listenerReady = false;
|
||||
t.start();
|
||||
open = true;
|
||||
synchronized (this) {
|
||||
while (!listenerReady && open) {
|
||||
try {
|
||||
wait();
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurePool(tunnel);
|
||||
|
||||
if (open && listenerReady) {
|
||||
l.log("Ready! Port " + getLocalPort());
|
||||
notifyEvent("openBaseClientResult", "ok");
|
||||
} else {
|
||||
l.log("Error listening - please see the logs!");
|
||||
notifyEvent("openBaseClientResult", "error");
|
||||
}
|
||||
}
|
||||
public I2PTunnelClientBase(int localPort, boolean ownDest, Logging l,
|
||||
EventDispatcher notifyThis, String handlerName,
|
||||
I2PTunnel tunnel) throws IllegalArgumentException {
|
||||
@ -153,7 +193,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
|
||||
} // else delay creating session until createI2PSocket() is called
|
||||
|
||||
Thread t = new I2PThread(this);
|
||||
Thread t = new I2PAppThread(this);
|
||||
t.setName("Client " + _clientId);
|
||||
listenerReady = false;
|
||||
t.start();
|
||||
@ -188,7 +228,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
*
|
||||
*/
|
||||
private void configurePool(I2PTunnel tunnel) {
|
||||
_waitingSockets = new ArrayList(4);
|
||||
//_waitingSockets = new ArrayList(4);
|
||||
|
||||
Properties opts = tunnel.getClientOptions();
|
||||
String maxWait = opts.getProperty(PROP_MAX_WAIT_TIME, DEFAULT_MAX_WAIT_TIME+"");
|
||||
@ -207,7 +247,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
|
||||
for (int i = 0; i < _numConnectionBuilders; i++) {
|
||||
String name = "ClientBuilder" + _clientId + '.' + i;
|
||||
I2PThread b = new I2PThread(new TunnelConnectionBuilder(), name);
|
||||
I2PAppThread b = new I2PAppThread(new TunnelConnectionBuilder(), name);
|
||||
b.setDaemon(true);
|
||||
b.start();
|
||||
}
|
||||
@ -350,7 +390,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
* called by derived classes after initialization.
|
||||
*
|
||||
*/
|
||||
public final void startRunning() {
|
||||
public void startRunning() {
|
||||
synchronized (startLock) {
|
||||
startRunning = true;
|
||||
startLock.notify();
|
||||
@ -490,7 +530,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
protected void manageConnection(Socket s) {
|
||||
if (s == null) return;
|
||||
if (_numConnectionBuilders <= 0) {
|
||||
new I2PThread(new BlockingRunner(s), "Clinet run").start();
|
||||
new I2PAppThread(new BlockingRunner(s), "Clinet run").start();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -543,6 +583,8 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
}
|
||||
|
||||
public boolean close(boolean forced) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("close() called: forced = " + forced + " open = " + open + " sockMgr = " + sockMgr);
|
||||
if (!open) return true;
|
||||
// FIXME: here we might have to wait quite a long time if
|
||||
// there is a connection attempt atm. But without waiting we
|
||||
@ -559,10 +601,12 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!chained) {
|
||||
I2PSession session = sockMgr.getSession();
|
||||
if (session != null) {
|
||||
getTunnel().removeSession(session);
|
||||
}
|
||||
} // else the app chaining to this one closes it!
|
||||
}
|
||||
l.log("Closing client " + toString());
|
||||
open = false;
|
||||
@ -599,7 +643,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
while (open) {
|
||||
try {
|
||||
synchronized (_waitingSockets) {
|
||||
if (_waitingSockets.size() <= 0)
|
||||
if (_waitingSockets.isEmpty())
|
||||
_waitingSockets.wait();
|
||||
else
|
||||
s = (Socket)_waitingSockets.remove(0);
|
||||
|
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
* Version 2, December 2004
|
||||
*
|
||||
* Copyright (C) sponge
|
||||
* Planet Earth
|
||||
* Everyone is permitted to copy and distribute verbatim or modified
|
||||
* copies of this license document, and changing it is allowed as long
|
||||
* as the name is changed.
|
||||
*
|
||||
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
*
|
||||
* 0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
*
|
||||
* See...
|
||||
*
|
||||
* http://sam.zoy.org/wtfpl/
|
||||
* and
|
||||
* http://en.wikipedia.org/wiki/WTFPL
|
||||
*
|
||||
* ...for any additional details and liscense questions.
|
||||
*/
|
||||
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
// import java.util.ArrayList;
|
||||
|
||||
import net.i2p.client.streaming.I2PSocketManager;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
|
||||
|
||||
/**
|
||||
* Reuse HTTP server's I2PSocketManager for a proxy with no outproxy capability.
|
||||
*
|
||||
* @author sponge
|
||||
*/
|
||||
public class I2PTunnelHTTPBidirProxy extends I2PTunnelHTTPClient implements Runnable {
|
||||
|
||||
|
||||
/**
|
||||
* @throws IllegalArgumentException if the I2PTunnel does not contain
|
||||
* valid config to contact the router
|
||||
*/
|
||||
public I2PTunnelHTTPBidirProxy(int localPort, Logging l, I2PSocketManager sockMgr, I2PTunnel tunnel, EventDispatcher notifyThis, long clientId) {
|
||||
super(localPort, l, sockMgr, tunnel, notifyThis, clientId);
|
||||
// proxyList = new ArrayList();
|
||||
|
||||
setName(getLocalPort() + " -> HTTPClient [NO PROXIES]");
|
||||
startRunning();
|
||||
|
||||
notifyEvent("openHTTPClientResult", "ok");
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/* I2PTunnel is GPL'ed (with the exception mentioned in I2PTunnel.java)
|
||||
* (c) 2003 - 2004 mihi
|
||||
*/
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class I2PTunnelHTTPBidirServer extends I2PTunnelHTTPServer {
|
||||
private final static Log log = new Log(I2PTunnelHTTPBidirServer.class);
|
||||
|
||||
public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, String privData, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privData, spoofHost, l, notifyThis, tunnel);
|
||||
finishSetupI2PTunnelHTTPBidirServer(l, proxyport);
|
||||
}
|
||||
|
||||
public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privkey, privkeyname, spoofHost, l, notifyThis, tunnel);
|
||||
finishSetupI2PTunnelHTTPBidirServer(l, proxyport);
|
||||
}
|
||||
|
||||
public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privData, privkeyname, spoofHost, l, notifyThis, tunnel);
|
||||
finishSetupI2PTunnelHTTPBidirServer(l, proxyport);
|
||||
}
|
||||
|
||||
private void finishSetupI2PTunnelHTTPBidirServer(Logging l, int proxyport) {
|
||||
|
||||
localPort = proxyport;
|
||||
bidir = true;
|
||||
|
||||
/* start the httpclient */
|
||||
task = new I2PTunnelHTTPBidirProxy(localPort, l, sockMgr, getTunnel(), getEventDispatcher(), __serverId);
|
||||
sockMgr.setName("Server"); // TO-DO: Need to change this to "Bidir"!
|
||||
getTunnel().addSession(sockMgr.getSession());
|
||||
l.log("Ready!");
|
||||
notifyEvent("openServerResult", "ok");
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,10 @@
|
||||
*/
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
@ -15,19 +17,23 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.I2PException;
|
||||
import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.client.streaming.I2PSocketManager;
|
||||
import net.i2p.client.streaming.I2PSocketOptions;
|
||||
import net.i2p.data.Base32;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.FileUtil;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.Translate;
|
||||
|
||||
/**
|
||||
* Act as a mini HTTP proxy, handling various different types of requests,
|
||||
@ -40,8 +46,14 @@ import net.i2p.util.Log;
|
||||
* $method http://i2p/$b64key/$path $protocolVersion
|
||||
* or
|
||||
* $method /$site/$path $protocolVersion
|
||||
* or (deprecated)
|
||||
* $method /eepproxy/$site/$path $protocolVersion
|
||||
* </pre>
|
||||
*
|
||||
* Note that http://i2p/$b64key/... and /eepproxy/$site/... are not recommended
|
||||
* in browsers or other user-visible applications, as relative links will not
|
||||
* resolve correctly, cookies won't work, etc.
|
||||
*
|
||||
* If the $site resolves with the I2P naming service, then it is directed towards
|
||||
* that eepsite, otherwise it is directed towards this client's outproxy (typically
|
||||
* "squid.i2p"). Only HTTP is supported (no HTTPS, ftp, mailto, etc). Both GET
|
||||
@ -51,10 +63,14 @@ import net.i2p.util.Log;
|
||||
public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable {
|
||||
private static final Log _log = new Log(I2PTunnelHTTPClient.class);
|
||||
|
||||
private final List proxyList;
|
||||
protected final List proxyList = new ArrayList();
|
||||
|
||||
private HashMap addressHelpers = new HashMap();
|
||||
|
||||
/**
|
||||
* These are backups if the xxx.ht error page is missing.
|
||||
*/
|
||||
|
||||
private final static byte[] ERR_REQUEST_DENIED =
|
||||
("HTTP/1.1 403 Access Denied\r\n"+
|
||||
"Content-Type: text/html; charset=iso-8859-1\r\n"+
|
||||
@ -77,6 +93,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
"Could not find the following Destination:<BR><BR><div>")
|
||||
.getBytes();
|
||||
|
||||
/*****
|
||||
private final static byte[] ERR_TIMEOUT =
|
||||
("HTTP/1.1 504 Gateway Timeout\r\n"+
|
||||
"Content-Type: text/html; charset=iso-8859-1\r\n"+
|
||||
@ -88,6 +105,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
"destination may have issues. Could not get a response from "+
|
||||
"the following Destination:<BR><BR>")
|
||||
.getBytes();
|
||||
*****/
|
||||
|
||||
private final static byte[] ERR_NO_OUTPROXY =
|
||||
("HTTP/1.1 503 Service Unavailable\r\n"+
|
||||
@ -108,11 +126,11 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
"The addresshelper link you followed specifies a different destination key "+
|
||||
"than a host entry in your host database. "+
|
||||
"Someone could be trying to impersonate another eepsite, "+
|
||||
"or people have given two eepsites identical names.<P/>"+
|
||||
"or people have given two eepsites identical names.<p>"+
|
||||
"You can resolve the conflict by considering which key you trust, "+
|
||||
"and either discarding the addresshelper link, "+
|
||||
"discarding the host entry from your host database, "+
|
||||
"or naming one of them differently.<P/>")
|
||||
"or naming one of them differently.<p>")
|
||||
.getBytes();
|
||||
|
||||
private final static byte[] ERR_BAD_PROTOCOL =
|
||||
@ -139,7 +157,15 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
private static final File _errorDir = new File(I2PAppContext.getGlobalContext().getBaseDir(), "docs");
|
||||
|
||||
public I2PTunnelHTTPClient(int localPort, Logging l, I2PSocketManager sockMgr, I2PTunnel tunnel, EventDispatcher notifyThis, long clientId) {
|
||||
super(localPort, l, sockMgr, tunnel, notifyThis, clientId);
|
||||
// proxyList = new ArrayList();
|
||||
|
||||
setName(getLocalPort() + " -> HTTPClient [NO PROXIES]");
|
||||
startRunning();
|
||||
|
||||
notifyEvent("openHTTPClientResult", "ok");
|
||||
}
|
||||
/**
|
||||
* @throws IllegalArgumentException if the I2PTunnel does not contain
|
||||
* valid config to contact the router
|
||||
@ -149,7 +175,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
I2PTunnel tunnel) throws IllegalArgumentException {
|
||||
super(localPort, ownDest, l, notifyThis, "HTTPHandler " + (++__clientId), tunnel);
|
||||
|
||||
proxyList = new ArrayList();
|
||||
//proxyList = new ArrayList(); // We won't use outside of i2p
|
||||
if (waitEventValue("openBaseClientResult").equals("error")) {
|
||||
notifyEvent("openHTTPClientResult", "error");
|
||||
return;
|
||||
@ -176,7 +202,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
if (size <= 0) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Proxy list is empty - no outproxy available");
|
||||
l.log("Proxy list is emtpy - no outproxy available");
|
||||
l.log("Proxy list is empty - no outproxy available");
|
||||
return null;
|
||||
}
|
||||
int index = I2PAppContext.getGlobalContext().random().nextInt(size);
|
||||
@ -224,11 +250,36 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
return opts;
|
||||
}
|
||||
|
||||
private InternalSocketRunner isr;
|
||||
|
||||
/**
|
||||
* Actually start working on incoming connections.
|
||||
* Overridden to start an internal socket too.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void startRunning() {
|
||||
super.startRunning();
|
||||
this.isr = new InternalSocketRunner(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridden to close internal socket too.
|
||||
*/
|
||||
@Override
|
||||
public boolean close(boolean forced) {
|
||||
boolean rv = super.close(forced);
|
||||
if (this.isr != null)
|
||||
this.isr.stopRunning();
|
||||
return rv;
|
||||
}
|
||||
|
||||
private static final boolean DEFAULT_GZIP = true;
|
||||
// all default to false
|
||||
public static final String PROP_REFERER = "i2ptunnel.httpclient.sendReferer";
|
||||
public static final String PROP_USER_AGENT = "i2ptunnel.httpclient.sendUserAgent";
|
||||
public static final String PROP_VIA = "i2ptunnel.httpclient.sendVia";
|
||||
public static final String PROP_JUMP_SERVERS = "i2ptunnel.httpclient.jumpServers";
|
||||
|
||||
private static long __requestId = 0;
|
||||
protected void clientConnectionRun(Socket s) {
|
||||
@ -236,6 +287,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
OutputStream out = null;
|
||||
String targetRequest = null;
|
||||
boolean usingWWWProxy = false;
|
||||
boolean usingInternalServer = false;
|
||||
String currentProxy = null;
|
||||
long requestId = ++__requestId;
|
||||
try {
|
||||
@ -257,13 +309,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
if (method == null) { // first line (GET /base64/realaddr)
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(getPrefix(requestId) + "Method is null for [" + line + "]");
|
||||
_log.debug(getPrefix(requestId) + "First line [" + line + "]");
|
||||
|
||||
int pos = line.indexOf(" ");
|
||||
if (pos == -1) break;
|
||||
method = line.substring(0, pos);
|
||||
// TODO use Java URL class to make all this simpler and more robust
|
||||
// That will also fix IPV6 [a:b:c]
|
||||
String request = line.substring(pos + 1);
|
||||
if (request.startsWith("/") && getTunnel().getClientOptions().getProperty("i2ptunnel.noproxy") != null) {
|
||||
// what is this for ???
|
||||
request = "http://i2p" + request;
|
||||
} else if (request.startsWith("/eepproxy/")) {
|
||||
// /eepproxy/foo.i2p/bar/baz.html HTTP/1.0
|
||||
@ -275,6 +330,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
// "http://" + "foo.i2p/bar/baz.html" + " HTTP/1.0"
|
||||
request = "http://" + uri + subRequest.substring(protopos);
|
||||
} else if (request.toLowerCase().startsWith("http://i2p/")) {
|
||||
// http://i2p/b64key/bar/baz.html HTTP/1.0
|
||||
String subRequest = request.substring("http://i2p/".length());
|
||||
int protopos = subRequest.indexOf(" ");
|
||||
String uri = subRequest.substring(0, protopos);
|
||||
if (uri.indexOf("/") == -1) {
|
||||
uri = uri + "/";
|
||||
}
|
||||
// "http://" + "b64key/bar/baz.html" + " HTTP/1.0"
|
||||
request = "http://" + uri + subRequest.substring(protopos);
|
||||
}
|
||||
|
||||
pos = request.indexOf("//");
|
||||
@ -287,6 +352,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
targetRequest = request;
|
||||
|
||||
// pos is the start of the path
|
||||
pos = request.indexOf("/");
|
||||
if (pos == -1) {
|
||||
method = null;
|
||||
@ -299,7 +365,17 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
int port = 80;
|
||||
if(posPort != -1) {
|
||||
String[] parts = host.split(":");
|
||||
try {
|
||||
host = parts[0];
|
||||
} catch (ArrayIndexOutOfBoundsException ex) {
|
||||
if (out != null) {
|
||||
out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
|
||||
}
|
||||
try {
|
||||
port = Integer.parseInt(parts[1]);
|
||||
} catch(Exception exc) {
|
||||
@ -307,8 +383,24 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
// Quick hack for foo.bar.i2p
|
||||
if (host.toLowerCase().endsWith(".i2p")) {
|
||||
// Go through the various types of host names, set
|
||||
// the host and destination variables accordingly,
|
||||
// and transform the first line.
|
||||
// For all i2p network hosts, ensure that the host is a
|
||||
// Base 32 hostname so that we do not reveal our name for it
|
||||
// in our addressbook (all naming is local),
|
||||
// and it is removed from the request line.
|
||||
|
||||
if (host.length() >= 516 && host.indexOf(".") < 0) {
|
||||
// http://b64key/bar/baz.html
|
||||
destination = host;
|
||||
host = getHostName(destination);
|
||||
line = method + ' ' + request.substring(pos);
|
||||
} else if (host.toLowerCase().equals("proxy.i2p")) {
|
||||
// so we don't do any naming service lookups
|
||||
destination = host;
|
||||
usingInternalServer = true;
|
||||
} else if (host.toLowerCase().endsWith(".i2p")) {
|
||||
// Destination gets the host name
|
||||
destination = host;
|
||||
// Host becomes the destination key
|
||||
@ -342,6 +434,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
// Key contains data, lets not ignore it
|
||||
if (ahelperKey != null) {
|
||||
// ahelperKey will be validated later
|
||||
|
||||
// Host resolvable only with addresshelper
|
||||
if ( (host == null) || ("i2p".equals(host)) )
|
||||
@ -351,12 +444,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
} else {
|
||||
// Host resolvable from database, verify addresshelper key
|
||||
// Silently bypass correct keys, otherwise alert
|
||||
if (!host.equals(ahelperKey))
|
||||
String destB64 = null;
|
||||
try {
|
||||
Destination _dest = I2PTunnel.destFromName(host);
|
||||
if (_dest != null)
|
||||
destB64 = _dest.toBase64();
|
||||
} catch (DataFormatException dfe) {}
|
||||
if (destB64 != null && !destB64.equals(ahelperKey))
|
||||
{
|
||||
// Conflict: handle when URL reconstruction done
|
||||
ahelperConflict = true;
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn(getPrefix(requestId) + "Addresshelper key conflict for site [" + destination + "], trusted key [" + host + "], specified key [" + ahelperKey + "].");
|
||||
_log.warn(getPrefix(requestId) + "Addresshelper key conflict for site [" + destination + "], trusted key [" + destB64 + "], specified key [" + ahelperKey + "].");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,22 +475,24 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
// Did addresshelper key conflict?
|
||||
if (ahelperConflict)
|
||||
{
|
||||
String str;
|
||||
byte[] header;
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "ahelper-conflict-header.ht")).getAbsolutePath(), 100, true);
|
||||
if (str != null) header = str.getBytes();
|
||||
else header = ERR_AHELPER_CONFLICT;
|
||||
|
||||
if (out != null) {
|
||||
long alias = I2PAppContext.getGlobalContext().random().nextLong();
|
||||
// convert ahelperKey to b32
|
||||
String alias = getHostName(ahelperKey);
|
||||
if (alias.equals("i2p")) {
|
||||
// bad ahelperKey
|
||||
byte[] header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
|
||||
writeErrorMessage(header, out, targetRequest, false, destination, null);
|
||||
} else {
|
||||
String trustedURL = protocol + uriPath + urlEncoding;
|
||||
String conflictURL = protocol + alias + ".i2p/?" + initialFragments;
|
||||
// Fixme - any path is lost
|
||||
String conflictURL = protocol + alias + '/' + urlEncoding;
|
||||
byte[] header = getErrorPage("ahelper-conflict", ERR_AHELPER_CONFLICT);
|
||||
out.write(header);
|
||||
out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<P/>").getBytes());
|
||||
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></div></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write(_("To visit the destination in your host database, click <a href=\"{0}\">here</a>. To visit the conflicting addresshelper destination, click <a href=\"{1}\">here</a>.", trustedURL, conflictURL).getBytes("UTF-8"));
|
||||
out.write(("<p></div>").getBytes());
|
||||
writeFooter(out);
|
||||
}
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
@ -406,13 +507,12 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
|
||||
line = method + " " + request.substring(pos);
|
||||
} else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1")) {
|
||||
} else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1") ||
|
||||
host.startsWith("192.168.")) {
|
||||
// if somebody is trying to get to 192.168.example.com, oh well
|
||||
if (out != null) {
|
||||
out.write(ERR_LOCALHOST);
|
||||
out.write("<p /><i>Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write(getErrorPage("localhost", ERR_LOCALHOST));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
@ -430,11 +530,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
_log.warn(getPrefix(requestId) + "Host wants to be outproxied, but we dont have any!");
|
||||
l.log("No HTTP outproxy found for the request.");
|
||||
if (out != null) {
|
||||
out.write(ERR_NO_OUTPROXY);
|
||||
out.write("<p /><i>Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write(getErrorPage("noproxy", ERR_NO_OUTPROXY));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
@ -444,44 +541,64 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(getPrefix(requestId) + "Host doesnt end with .i2p and it contains a period [" + host + "]: wwwProxy!");
|
||||
} else {
|
||||
// what is left for here? a hostname with no dots, and != "i2p"
|
||||
// and not a destination ???
|
||||
// Perhaps something in privatehosts.txt ...
|
||||
request = request.substring(pos + 1);
|
||||
pos = request.indexOf("/");
|
||||
if (pos < 0) {
|
||||
l.log("Invalid request url [" + request + "]");
|
||||
if (out != null) {
|
||||
out.write(ERR_REQUEST_DENIED);
|
||||
out.write("<p /><i>Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
}
|
||||
destination = request.substring(0, pos);
|
||||
host = getHostName(destination);
|
||||
line = method + " " + request.substring(pos);
|
||||
} // end host name processing
|
||||
|
||||
if (port != 80 && !usingWWWProxy) {
|
||||
if (out != null) {
|
||||
out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isValid = usingWWWProxy || isSupportedAddress(host, protocol);
|
||||
boolean isValid = usingWWWProxy || usingInternalServer || isSupportedAddress(host, protocol);
|
||||
if (!isValid) {
|
||||
if (_log.shouldLog(Log.INFO)) _log.info(getPrefix(requestId) + "notValid(" + host + ")");
|
||||
method = null;
|
||||
destination = null;
|
||||
break;
|
||||
} else if (!usingWWWProxy) {
|
||||
if (_log.shouldLog(Log.INFO)) _log.info(getPrefix(requestId) + "host=getHostName(" + destination + ")");
|
||||
host = getHostName(destination); // hide original host
|
||||
}
|
||||
|
||||
// don't do this, it forces yet another hostname lookup,
|
||||
// and in all cases host was already set above
|
||||
//if ((!usingWWWProxy) && (!usingInternalServer)) {
|
||||
// String oldhost = host;
|
||||
// host = getHostName(destination); // hide original host
|
||||
// if (_log.shouldLog(Log.INFO))
|
||||
// _log.info(getPrefix(requestId) + " oldhost " + oldhost + " newhost " + host + " dest " + destination);
|
||||
//}
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) {
|
||||
_log.debug(getPrefix(requestId) + "METHOD:" + method + ":");
|
||||
_log.debug(getPrefix(requestId) + "PROTOC:" + protocol + ":");
|
||||
_log.debug(getPrefix(requestId) + "HOST :" + host + ":");
|
||||
_log.debug(getPrefix(requestId) + "DEST :" + destination + ":");
|
||||
_log.debug(getPrefix(requestId) + "METHOD: \"" + method + "\"");
|
||||
_log.debug(getPrefix(requestId) + "PROTOC: \"" + protocol + "\"");
|
||||
_log.debug(getPrefix(requestId) + "HOST : \"" + host + "\"");
|
||||
_log.debug(getPrefix(requestId) + "DEST : \"" + destination + "\"");
|
||||
}
|
||||
|
||||
// end first line processing
|
||||
|
||||
} else {
|
||||
if (lowercaseLine.startsWith("host: ") && !usingWWWProxy) {
|
||||
// Note that we only pass the original Host: line through to the outproxy
|
||||
// But we don't create a Host: line if it wasn't sent to us
|
||||
line = "Host: " + host;
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(getPrefix(requestId) + "Setting host = " + host);
|
||||
@ -518,35 +635,38 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
boolean gzip = DEFAULT_GZIP;
|
||||
if (ok != null)
|
||||
gzip = Boolean.valueOf(ok).booleanValue();
|
||||
if (gzip) {
|
||||
if (gzip && !usingInternalServer) {
|
||||
// according to rfc2616 s14.3, this *should* force identity, even if
|
||||
// an explicit q=0 for gzip doesn't. tested against orion.i2p, and it
|
||||
// seems to work.
|
||||
newRequest.append("Accept-Encoding: \r\n");
|
||||
newRequest.append("X-Accept-Encoding: x-i2p-gzip;q=1.0, identity;q=0.5, deflate;q=0, gzip;q=0, *;q=0\r\n");
|
||||
}
|
||||
if (!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue())
|
||||
if (!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
|
||||
// let's not advertise to external sites that we are from I2P
|
||||
if (usingWWWProxy)
|
||||
newRequest.append("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6\r\n");
|
||||
else
|
||||
newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n");
|
||||
}
|
||||
newRequest.append("Connection: close\r\n\r\n");
|
||||
break;
|
||||
} else {
|
||||
newRequest.append(line).append("\r\n"); // HTTP spec
|
||||
}
|
||||
}
|
||||
} // end header processing
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(getPrefix(requestId) + "NewRequest header: [" + newRequest.toString() + "]");
|
||||
|
||||
if (method == null || destination == null) {
|
||||
l.log("No HTTP method found in the request.");
|
||||
//l.log("No HTTP method found in the request.");
|
||||
if (out != null) {
|
||||
if ("http://".equalsIgnoreCase(protocol))
|
||||
out.write(ERR_REQUEST_DENIED);
|
||||
out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
|
||||
else
|
||||
out.write(ERR_BAD_PROTOCOL);
|
||||
out.write("<p /><i>Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write(getErrorPage("protocol", ERR_BAD_PROTOCOL));
|
||||
writeFooter(out);
|
||||
}
|
||||
s.close();
|
||||
return;
|
||||
@ -557,35 +677,41 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
// Serve local proxy files (images, css linked from error pages)
|
||||
// Ignore all the headers
|
||||
if (destination.equals("proxy.i2p")) {
|
||||
if (usingInternalServer) {
|
||||
serveLocalFile(out, method, targetRequest);
|
||||
s.close();
|
||||
return;
|
||||
}
|
||||
|
||||
Destination clientDest = I2PTunnel.destFromName(destination);
|
||||
// If the host is "i2p", the getHostName() lookup failed, don't try to
|
||||
// look it up again as the naming service does not do negative caching
|
||||
// so it will be slow.
|
||||
|
||||
Destination clientDest;
|
||||
if ("i2p".equals(host))
|
||||
clientDest = null;
|
||||
else
|
||||
clientDest = I2PTunnel.destFromName(destination);
|
||||
|
||||
if (clientDest == null) {
|
||||
//l.log("Could not resolve " + destination + ".");
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
|
||||
String str;
|
||||
byte[] header;
|
||||
boolean showAddrHelper = false;
|
||||
String jumpServers = null;
|
||||
if (usingWWWProxy)
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true);
|
||||
header = getErrorPage("dnfp", ERR_DESTINATION_UNKNOWN);
|
||||
else if(ahelper != 0)
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnfb-header.ht")).getAbsolutePath(), 100, true);
|
||||
header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
|
||||
else if (destination.length() == 60 && destination.endsWith(".b32.i2p"))
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true);
|
||||
header = getErrorPage("dnf", ERR_DESTINATION_UNKNOWN);
|
||||
else {
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnfh-header.ht")).getAbsolutePath(), 100, true);
|
||||
showAddrHelper = true;
|
||||
header = getErrorPage("dnfh", ERR_DESTINATION_UNKNOWN);
|
||||
jumpServers = getTunnel().getClientOptions().getProperty(PROP_JUMP_SERVERS);
|
||||
if (jumpServers == null)
|
||||
jumpServers = DEFAULT_JUMP_SERVERS;
|
||||
}
|
||||
if (str != null)
|
||||
header = str.getBytes();
|
||||
else
|
||||
header = ERR_DESTINATION_UNKNOWN;
|
||||
writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, showAddrHelper);
|
||||
writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, jumpServers);
|
||||
s.close();
|
||||
return;
|
||||
}
|
||||
@ -601,24 +727,27 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
Runnable onTimeout = new OnTimeout(s, s.getOutputStream(), targetRequest, usingWWWProxy, currentProxy, requestId);
|
||||
I2PTunnelRunner runner = new I2PTunnelHTTPClientRunner(s, i2ps, sockLock, data, mySockets, onTimeout);
|
||||
} catch (SocketException ex) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(getPrefix(requestId) + "Error trying to connect", ex);
|
||||
l.log(ex.getMessage());
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
|
||||
closeSocket(s);
|
||||
} catch (IOException ex) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(getPrefix(requestId) + "Error trying to connect", ex);
|
||||
l.log(ex.getMessage());
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
|
||||
closeSocket(s);
|
||||
} catch (I2PException ex) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("getPrefix(requestId) + Error trying to connect", ex);
|
||||
l.log(ex.getMessage());
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
|
||||
closeSocket(s);
|
||||
} catch (OutOfMemoryError oom) {
|
||||
IOException ex = new IOException("OOM");
|
||||
_log.info("getPrefix(requestId) + Error trying to connect", ex);
|
||||
l.log(ex.getMessage());
|
||||
_log.error("getPrefix(requestId) + Error trying to connect", oom);
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
|
||||
closeSocket(s);
|
||||
}
|
||||
@ -630,6 +759,9 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
* We can't use BufferedReader for POST because we can't have readahead,
|
||||
* since we are passing the stream on to I2PTunnelRunner for the POST data.
|
||||
*
|
||||
* Warning - BufferedReader removes \r, DataHelper does not
|
||||
* Warning - DataHelper limits line length, BufferedReader does not
|
||||
* Todo: Limit line length for buffered reads, or go back to unbuffered for all
|
||||
*/
|
||||
private static class InputReader {
|
||||
BufferedReader _br;
|
||||
@ -639,25 +771,90 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
_s = s;
|
||||
}
|
||||
String readLine(String method) throws IOException {
|
||||
if (method == null || "POST".equals(method))
|
||||
// Use unbuffered until we can find a BufferedReader that limits line length
|
||||
//if (method == null || "POST".equals(method))
|
||||
return DataHelper.readLine(_s);
|
||||
if (_br == null)
|
||||
_br = new BufferedReader(new InputStreamReader(_s, "ISO-8859-1"));
|
||||
return _br.readLine();
|
||||
//if (_br == null)
|
||||
// _br = new BufferedReader(new InputStreamReader(_s, "ISO-8859-1"));
|
||||
//return _br.readLine();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return b32hash.b32.i2p, or "i2p" on lookup failure.
|
||||
* Prior to 0.7.12, returned b64 key
|
||||
*/
|
||||
private final static String getHostName(String host) {
|
||||
if (host == null) return null;
|
||||
if (host.length() == 60 && host.toLowerCase().endsWith(".b32.i2p"))
|
||||
return host;
|
||||
try {
|
||||
Destination dest = I2PTunnel.destFromName(host);
|
||||
if (dest == null) return "i2p";
|
||||
return dest.toBase64();
|
||||
return Base32.encode(dest.calculateHash().getData()) + ".b32.i2p";
|
||||
} catch (DataFormatException dfe) {
|
||||
return "i2p";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* foo => errordir/foo-header_xx.ht for lang xx, or errordir/foo-header.ht,
|
||||
* or the backup byte array on fail.
|
||||
*
|
||||
* .ht files must be UTF-8 encoded and use \r\n terminators so the
|
||||
* HTTP headers are conformant.
|
||||
* We can't use FileUtil.readFile() because it strips \r
|
||||
*
|
||||
* @return non-null
|
||||
*/
|
||||
private byte[] getErrorPage(String base, byte[] backup) {
|
||||
return getErrorPage(getTunnel().getContext(), base, backup);
|
||||
}
|
||||
|
||||
private static byte[] getErrorPage(I2PAppContext ctx, String base, byte[] backup) {
|
||||
File errorDir = new File(ctx.getBaseDir(), "docs");
|
||||
String lang = ctx.getProperty("routerconsole.lang", Locale.getDefault().getLanguage());
|
||||
if (lang != null && lang.length() > 0 && !lang.equals("en")) {
|
||||
File file = new File(errorDir, base + "-header_" + lang + ".ht");
|
||||
try {
|
||||
return readFile(file);
|
||||
} catch (IOException ioe) {
|
||||
// try the english version now
|
||||
}
|
||||
}
|
||||
File file = new File(errorDir, base + "-header.ht");
|
||||
try {
|
||||
return readFile(file);
|
||||
} catch (IOException ioe) {
|
||||
return backup;
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] readFile(File file) throws IOException {
|
||||
FileInputStream fis = null;
|
||||
byte[] buf = new byte[512];
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
|
||||
try {
|
||||
int len = 0;
|
||||
fis = new FileInputStream(file);
|
||||
while ((len = fis.read(buf)) > 0) {
|
||||
baos.write(buf, 0, len);
|
||||
}
|
||||
return baos.toByteArray();
|
||||
} finally {
|
||||
try { if (fis != null) fis.close(); } catch (IOException foo) {}
|
||||
}
|
||||
// we won't ever get here
|
||||
}
|
||||
|
||||
private static void writeFooter(OutputStream out) throws IOException {
|
||||
// the css is hiding this div for now, but we'll keep it here anyway
|
||||
out.write("<div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></div></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
}
|
||||
|
||||
private static class OnTimeout implements Runnable {
|
||||
private Socket _socket;
|
||||
private OutputStream _out;
|
||||
@ -682,15 +879,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
private static String jumpServers[] = {
|
||||
"http://i2host.i2p/cgi-bin/i2hostjump?",
|
||||
// "http://orion.i2p/jump/",
|
||||
"http://stats.i2p/cgi-bin/jump.cgi?a=",
|
||||
// "http://trevorreznik.i2p/cgi-bin/jump.php?hostname=",
|
||||
"http://i2jump.i2p/"
|
||||
};
|
||||
private static String DEFAULT_JUMP_SERVERS =
|
||||
"http://i2host.i2p/cgi-bin/i2hostjump?," +
|
||||
"http://stats.i2p/cgi-bin/jump.cgi?a=," +
|
||||
"http://i2jump.i2p/";
|
||||
|
||||
/**
|
||||
* @param jumpServers comma- or space-separated list, or null
|
||||
*/
|
||||
private static void writeErrorMessage(byte[] errMessage, OutputStream out, String targetRequest,
|
||||
boolean usingWWWProxy, String wwwProxy, boolean showAddrHelper) throws IOException {
|
||||
boolean usingWWWProxy, String wwwProxy, String jumpServers) throws IOException {
|
||||
if (out != null) {
|
||||
out.write(errMessage);
|
||||
if (targetRequest != null) {
|
||||
@ -705,12 +903,19 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
out.write("\">http://".getBytes());
|
||||
out.write(uri.getBytes());
|
||||
out.write("</a>".getBytes());
|
||||
if (usingWWWProxy) out.write(("<br />WWW proxy: " + wwwProxy).getBytes());
|
||||
if (showAddrHelper) {
|
||||
out.write("<br /><br />Click a link below to look for an address helper by using a \"jump\" service:<br />".getBytes());
|
||||
for (int i = 0; i < jumpServers.length; i++) {
|
||||
if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
|
||||
if (jumpServers != null && jumpServers.length() > 0) {
|
||||
out.write("<br><br>".getBytes());
|
||||
out.write(_("Click a link below to look for an address helper by using a \"jump\" service:").getBytes("UTF-8"));
|
||||
out.write("<br>".getBytes());
|
||||
|
||||
StringTokenizer tok = new StringTokenizer(jumpServers, ", ");
|
||||
while (tok.hasMoreTokens()) {
|
||||
String jurl = tok.nextToken();
|
||||
if (!jurl.startsWith("http://"))
|
||||
continue;
|
||||
// Skip jump servers we don't know
|
||||
String jumphost = jumpServers[i].substring(7); // "http://"
|
||||
String jumphost = jurl.substring(7); // "http://"
|
||||
jumphost = jumphost.substring(0, jumphost.indexOf('/'));
|
||||
try {
|
||||
Destination dest = I2PTunnel.destFromName(jumphost);
|
||||
@ -719,20 +924,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
continue;
|
||||
}
|
||||
|
||||
out.write("<br /><a href=\"".getBytes());
|
||||
out.write(jumpServers[i].getBytes());
|
||||
out.write("<br><a href=\"".getBytes());
|
||||
out.write(jurl.getBytes());
|
||||
out.write(uri.getBytes());
|
||||
out.write("\">".getBytes());
|
||||
out.write(jumpServers[i].getBytes());
|
||||
out.write(jurl.getBytes());
|
||||
out.write(uri.getBytes());
|
||||
out.write("</a>".getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
|
||||
out.write(new Date().toString().getBytes());
|
||||
out.write("</i></div></body></html>\n".getBytes());
|
||||
out.flush();
|
||||
out.write("</div>".getBytes());
|
||||
writeFooter(out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,17 +947,12 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
// _log.warn(getPrefix(requestId) + "Error sending to " + wwwProxy + " (proxy? " + usingWWWProxy + ", request: " + targetRequest, ex);
|
||||
if (out != null) {
|
||||
try {
|
||||
String str;
|
||||
byte[] header;
|
||||
if (usingWWWProxy)
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true);
|
||||
header = getErrorPage(I2PAppContext.getGlobalContext(), "dnfp", ERR_DESTINATION_UNKNOWN);
|
||||
else
|
||||
str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true);
|
||||
if (str != null)
|
||||
header = str.getBytes();
|
||||
else
|
||||
header = ERR_DESTINATION_UNKNOWN;
|
||||
writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, false);
|
||||
header = getErrorPage(I2PAppContext.getGlobalContext(), "dnf", ERR_DESTINATION_UNKNOWN);
|
||||
writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, null);
|
||||
} catch (IOException ioe) {
|
||||
// static
|
||||
//_log.warn(getPrefix(requestId) + "Error writing out the 'destination was unknown' " + "message", ioe);
|
||||
@ -767,8 +965,14 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
private final static String SUPPORTED_HOSTS[] = { "i2p", "www.i2p.com", "i2p."};
|
||||
|
||||
/** @param host ignored */
|
||||
private static boolean isSupportedAddress(String host, String protocol) {
|
||||
if ((host == null) || (protocol == null)) return false;
|
||||
|
||||
/****
|
||||
* Let's not look up the name _again_
|
||||
* and now that host is a b32, this was failing
|
||||
*
|
||||
boolean found = false;
|
||||
String lcHost = host.toLowerCase();
|
||||
for (int i = 0; i < SUPPORTED_HOSTS.length; i++) {
|
||||
@ -785,7 +989,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
} catch (DataFormatException dfe) {
|
||||
}
|
||||
}
|
||||
|
||||
****/
|
||||
return protocol.equalsIgnoreCase("http://");
|
||||
}
|
||||
|
||||
@ -864,4 +1068,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
||||
out.flush();
|
||||
} catch (IOException ioe) {}
|
||||
}
|
||||
|
||||
|
||||
private static final String BUNDLE_NAME = "net.i2p.i2ptunnel.web.messages";
|
||||
|
||||
/** lang in routerconsole.lang property, else current locale */
|
||||
public static String _(String key) {
|
||||
return Translate.getString(key, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** {0} and {1} */
|
||||
public static String _(String key, Object o, Object o2) {
|
||||
return Translate.getString(key, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import java.util.zip.GZIPOutputStream;
|
||||
import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.data.Base32;
|
||||
|
||||
@ -39,20 +39,20 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
|
||||
public I2PTunnelHTTPServer(InetAddress host, int port, String privData, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privData, l, notifyThis, tunnel);
|
||||
_spoofHost = spoofHost;
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel", new long[] { 60*1000, 10*60*1000 });
|
||||
setupI2PTunnelHTTPServer(spoofHost);
|
||||
}
|
||||
|
||||
public I2PTunnelHTTPServer(InetAddress host, int port, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privkey, privkeyname, l, notifyThis, tunnel);
|
||||
_spoofHost = spoofHost;
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
|
||||
setupI2PTunnelHTTPServer(spoofHost);
|
||||
}
|
||||
|
||||
public I2PTunnelHTTPServer(InetAddress host, int port, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host, port, privData, privkeyname, l, notifyThis, tunnel);
|
||||
setupI2PTunnelHTTPServer(spoofHost);
|
||||
}
|
||||
|
||||
private void setupI2PTunnelHTTPServer(String spoofHost) {
|
||||
_spoofHost = spoofHost;
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
|
||||
@ -118,7 +118,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
useGZIP = true;
|
||||
|
||||
if (allowGZIP && useGZIP) {
|
||||
I2PThread req = new I2PThread(new CompressedRequestor(s, socket, modifiedHeader), Thread.currentThread().getName()+".hc");
|
||||
I2PAppThread req = new I2PAppThread(new CompressedRequestor(s, socket, modifiedHeader), Thread.currentThread().getName()+".hc");
|
||||
req.start();
|
||||
} else {
|
||||
new I2PTunnelRunner(s, socket, slock, null, modifiedHeader.getBytes(), null);
|
||||
@ -151,7 +151,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
_log.warn("Took a while to handle the request [" + timeToHandle + ", socket create: " + (afterSocket-afterAccept) + "]");
|
||||
}
|
||||
|
||||
private class CompressedRequestor implements Runnable {
|
||||
private static class CompressedRequestor implements Runnable {
|
||||
private Socket _webserver;
|
||||
private I2PSocket _browser;
|
||||
private String _headers;
|
||||
@ -174,7 +174,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
_log.info("request headers: " + _headers);
|
||||
serverout.write(_headers.getBytes());
|
||||
browserin = _browser.getInputStream();
|
||||
I2PThread sender = new I2PThread(new Sender(serverout, browserin, "server: browser to server"), Thread.currentThread().getName() + "hcs");
|
||||
I2PAppThread sender = new I2PAppThread(new Sender(serverout, browserin, "server: browser to server"), Thread.currentThread().getName() + "hcs");
|
||||
sender.start();
|
||||
|
||||
browserout = _browser.getOutputStream();
|
||||
@ -214,7 +214,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
}
|
||||
}
|
||||
}
|
||||
private class Sender implements Runnable {
|
||||
|
||||
private static class Sender implements Runnable {
|
||||
private OutputStream _out;
|
||||
private InputStream _in;
|
||||
private String _name;
|
||||
@ -248,7 +249,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
}
|
||||
}
|
||||
}
|
||||
private class CompressedResponseOutputStream extends HTTPResponseOutputStream {
|
||||
|
||||
private static class CompressedResponseOutputStream extends HTTPResponseOutputStream {
|
||||
private InternalGZIPOutputStream _gzipOut;
|
||||
public CompressedResponseOutputStream(OutputStream o) {
|
||||
super(o);
|
||||
@ -287,7 +289,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
private class InternalGZIPOutputStream extends GZIPOutputStream {
|
||||
|
||||
private static class InternalGZIPOutputStream extends GZIPOutputStream {
|
||||
public InternalGZIPOutputStream(OutputStream target) throws IOException {
|
||||
super(target);
|
||||
}
|
||||
@ -309,7 +312,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
}
|
||||
}
|
||||
|
||||
private String formatHeaders(Properties headers, StringBuilder command) {
|
||||
private static String formatHeaders(Properties headers, StringBuilder command) {
|
||||
StringBuilder buf = new StringBuilder(command.length() + headers.size() * 64);
|
||||
buf.append(command.toString().trim()).append("\r\n");
|
||||
for (Iterator iter = headers.keySet().iterator(); iter.hasNext(); ) {
|
||||
@ -321,6 +324,9 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** ridiculously long, just to prevent OOM DOS @since 0.7.13 */
|
||||
private static final int MAX_HEADERS = 60;
|
||||
|
||||
private Properties readHeaders(InputStream in, StringBuilder command) throws IOException {
|
||||
Properties headers = new Properties();
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
@ -344,7 +350,10 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
if (trimmed > 0)
|
||||
getTunnel().getContext().statManager().addRateData("i2ptunnel.httpNullWorkaround", trimmed, 0);
|
||||
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (++i > MAX_HEADERS)
|
||||
throw new IOException("Too many header lines - max " + MAX_HEADERS);
|
||||
buf.setLength(0);
|
||||
ok = DataHelper.readLine(in, buf);
|
||||
if (!ok) throw new IOException("EOF reached before the end of the headers [" + buf.toString() + "]");
|
||||
|
@ -14,9 +14,12 @@ import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Todo: Can we extend I2PTunnelClient instead and remove some duplicated code?
|
||||
*/
|
||||
public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable {
|
||||
|
||||
private static final Log _log = new Log(I2PTunnelIRCClient.class);
|
||||
@ -25,7 +28,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
private static volatile long __clientId = 0;
|
||||
|
||||
/** list of Destination objects that we point at */
|
||||
protected List dests;
|
||||
protected List<Destination> dests;
|
||||
private static final long DEFAULT_READ_TIMEOUT = 5*60*1000; // -1
|
||||
protected long readTimeout = DEFAULT_READ_TIMEOUT;
|
||||
|
||||
@ -47,7 +50,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
"IRCHandler " + (++__clientId), tunnel, pkf);
|
||||
|
||||
StringTokenizer tok = new StringTokenizer(destinations, ", ");
|
||||
dests = new ArrayList(1);
|
||||
dests = new ArrayList(2);
|
||||
while (tok.hasMoreTokens()) {
|
||||
String destination = tok.nextToken();
|
||||
try {
|
||||
@ -61,10 +64,21 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
if (dests.size() <= 0) {
|
||||
if (dests.isEmpty()) {
|
||||
l.log("No target destinations found");
|
||||
notifyEvent("openClientResult", "error");
|
||||
return;
|
||||
// Nothing is listening for the above event, so it's useless
|
||||
// Maybe figure out where to put a waitEventValue("openClientResult") ??
|
||||
// In the meantime, let's do this the easy way
|
||||
// Note that b32 dests will often not be resolvable at instantiation time;
|
||||
// a delayed resolution system would be even better.
|
||||
|
||||
// Don't close() here, because it does a removeSession() and then
|
||||
// TunnelController can't acquire() it to release() it.
|
||||
//close(true);
|
||||
// Unfortunately, super() built the whole tunnel before we get here.
|
||||
throw new IllegalArgumentException("No valid target destinations found");
|
||||
//return;
|
||||
}
|
||||
|
||||
setName(getLocalPort() + " -> IRCClient");
|
||||
@ -82,15 +96,15 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
try {
|
||||
i2ps = createI2PSocket(clientDest);
|
||||
i2ps.setReadTimeout(readTimeout);
|
||||
StringBuilder expectedPong = new StringBuilder();
|
||||
Thread in = new I2PThread(new IrcInboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " in");
|
||||
StringBuffer expectedPong = new StringBuffer();
|
||||
Thread in = new I2PAppThread(new IrcInboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " in", true);
|
||||
in.start();
|
||||
Thread out = new I2PThread(new IrcOutboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " out");
|
||||
Thread out = new I2PAppThread(new IrcOutboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " out", true);
|
||||
out.start();
|
||||
} catch (Exception ex) {
|
||||
if (_log.shouldLog(Log.ERROR))
|
||||
_log.error("Error connecting", ex);
|
||||
l.log(ex.getMessage());
|
||||
//l.log("Error connecting: " + ex.getMessage());
|
||||
closeSocket(s);
|
||||
if (i2ps != null) {
|
||||
synchronized (sockLock) {
|
||||
@ -109,27 +123,28 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
return null;
|
||||
}
|
||||
if (size == 1) // skip the rand in the most common case
|
||||
return (Destination)dests.get(0);
|
||||
return dests.get(0);
|
||||
int index = I2PAppContext.getGlobalContext().random().nextInt(size);
|
||||
return (Destination)dests.get(index);
|
||||
return dests.get(index);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
*/
|
||||
private class IrcInboundFilter implements Runnable {
|
||||
public static class IrcInboundFilter implements Runnable {
|
||||
|
||||
private Socket local;
|
||||
private I2PSocket remote;
|
||||
private StringBuilder expectedPong;
|
||||
private StringBuffer expectedPong;
|
||||
|
||||
IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuilder pong) {
|
||||
public IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
|
||||
local=_local;
|
||||
remote=_remote;
|
||||
expectedPong=pong;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
// Todo: Don't use BufferedReader - IRC spec limits line length to 512 but...
|
||||
BufferedReader in;
|
||||
OutputStream output;
|
||||
try {
|
||||
@ -191,19 +206,20 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
/*************************************************************************
|
||||
*
|
||||
*/
|
||||
private class IrcOutboundFilter implements Runnable {
|
||||
public static class IrcOutboundFilter implements Runnable {
|
||||
|
||||
private Socket local;
|
||||
private I2PSocket remote;
|
||||
private StringBuilder expectedPong;
|
||||
private StringBuffer expectedPong;
|
||||
|
||||
IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuilder pong) {
|
||||
public IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
|
||||
local=_local;
|
||||
remote=_remote;
|
||||
expectedPong=pong;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
// Todo: Don't use BufferedReader - IRC spec limits line length to 512 but...
|
||||
BufferedReader in;
|
||||
OutputStream output;
|
||||
try {
|
||||
@ -266,7 +282,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
*
|
||||
*/
|
||||
|
||||
public String inboundFilter(String s, StringBuilder expectedPong) {
|
||||
public static String inboundFilter(String s, StringBuffer expectedPong) {
|
||||
|
||||
String field[]=s.split(" ",4);
|
||||
String command;
|
||||
@ -353,7 +369,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
return null;
|
||||
}
|
||||
|
||||
public String outboundFilter(String s, StringBuilder expectedPong) {
|
||||
public static String outboundFilter(String s, StringBuffer expectedPong) {
|
||||
|
||||
String field[]=s.split(" ",3);
|
||||
String command;
|
||||
@ -371,14 +387,15 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
// "QUIT", // replace with a filtered QUIT to hide client quit messages
|
||||
"SILENCE",
|
||||
"MAP", // seems safe enough, the ircd should protect themselves though
|
||||
"PART",
|
||||
// "PART", // replace with filtered PART to hide client part messages
|
||||
"OPER",
|
||||
// "PONG", // replaced with a filtered PING/PONG since some clients send the server IP (thanks aardvax!)
|
||||
// "PING",
|
||||
"KICK",
|
||||
"HELPME",
|
||||
"RULES",
|
||||
"TOPIC"
|
||||
"TOPIC",
|
||||
"ISON" // jIRCii uses this for a ping (response is 303)
|
||||
};
|
||||
|
||||
if(field[0].length()==0)
|
||||
@ -390,7 +407,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
command = field[0].toUpperCase();
|
||||
|
||||
if ("PING".equalsIgnoreCase(command)) {
|
||||
if ("PING".equals(command)) {
|
||||
// Most clients just send a PING and are happy with any old PONG. Others,
|
||||
// like BitchX, actually expect certain behavior. It sends two different pings:
|
||||
// "PING :irc.freshcoffee.i2p" and "PING 1234567890 127.0.0.1" (where the IP is the proxy)
|
||||
@ -426,19 +443,19 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
|
||||
return rv;
|
||||
}
|
||||
if ("PONG".equalsIgnoreCase(command))
|
||||
if ("PONG".equals(command))
|
||||
return "PONG 127.0.0.1"; // no way to know what the ircd to i2ptunnel server con is, so localhost works
|
||||
|
||||
// Allow all allowedCommands
|
||||
for(int i=0;i<allowedCommands.length;i++)
|
||||
{
|
||||
if(allowedCommands[i].equalsIgnoreCase(command))
|
||||
if(allowedCommands[i].equals(command))
|
||||
return s;
|
||||
}
|
||||
|
||||
// mIRC sends "NOTICE user :DCC Send file (IP)"
|
||||
// in addition to the CTCP version
|
||||
if("NOTICE".equalsIgnoreCase(command))
|
||||
if("NOTICE".equals(command))
|
||||
{
|
||||
String msg = field[2];
|
||||
if(msg.startsWith(":DCC "))
|
||||
@ -447,7 +464,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
}
|
||||
|
||||
// Allow PRIVMSG, but block CTCP (except ACTION).
|
||||
if("PRIVMSG".equalsIgnoreCase(command) || "NOTICE".equalsIgnoreCase(command))
|
||||
if("PRIVMSG".equals(command) || "NOTICE".equals(command))
|
||||
{
|
||||
String msg;
|
||||
msg = field[2];
|
||||
@ -465,14 +482,21 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
|
||||
return s;
|
||||
}
|
||||
|
||||
if("USER".equalsIgnoreCase(command)) {
|
||||
if("USER".equals(command)) {
|
||||
int idx = field[2].lastIndexOf(":");
|
||||
if(idx<0)
|
||||
return "USER user hostname localhost :realname";
|
||||
String realname = field[2].substring(idx+1);
|
||||
String ret = "USER "+field[1]+" hostname localhost :"+realname;
|
||||
return ret;
|
||||
} else if ("QUIT".equalsIgnoreCase(command)) {
|
||||
}
|
||||
|
||||
if ("PART".equals(command)) {
|
||||
// hide client message
|
||||
return "PART " + field[1] + " :leaving";
|
||||
}
|
||||
|
||||
if ("QUIT".equals(command)) {
|
||||
return "QUIT :leaving";
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,9 @@ import net.i2p.util.Log;
|
||||
*
|
||||
* There are three options for mangling the desthash. Put the option in the
|
||||
* "custom options" section of i2ptunnel.
|
||||
* - ircserver.method unset: Defaults to user.
|
||||
* - ircserver.method=user: Use method described above.
|
||||
* - ircserver.method=webirc: Use the WEBIRC protocol.
|
||||
* - ircserver.cloakKey unset: Cloak with a random value that is persistent for
|
||||
* the life of this tunnel. This is the default.
|
||||
* - ircserver.cloakKey=somepassphrase: Cloak with the hash of the passphrase. Use this to
|
||||
@ -39,6 +42,8 @@ import net.i2p.util.Log;
|
||||
* be able to track users even when they switch servers.
|
||||
* Note: don't quote or put spaces in the passphrase,
|
||||
* the i2ptunnel gui can't handle it.
|
||||
* - ircserver.webircPassword=password The password to use for the WEBIRC protocol.
|
||||
* - ircserver.webircSpoofIP=IP The IP
|
||||
* - ircserver.fakeHostname=%f.b32.i2p: Set the fake hostname sent by I2PTunnel,
|
||||
* %f is the full B32 destination hash
|
||||
* %c is the cloaked hash.
|
||||
@ -48,7 +53,12 @@ import net.i2p.util.Log;
|
||||
* @author zzz
|
||||
*/
|
||||
public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
public static final String PROP_METHOD="ircserver.method";
|
||||
public static final String PROP_METHOD_DEFAULT="user";
|
||||
public static final String PROP_CLOAK="ircserver.cloakKey";
|
||||
public static final String PROP_WEBIRC_PASSWORD="ircserver.webircPassword";
|
||||
public static final String PROP_WEBIRC_SPOOF_IP="ircserver.webircSpoofIP";
|
||||
public static final String PROP_WEBIRC_SPOOF_IP_DEFAULT="127.0.0.1";
|
||||
public static final String PROP_HOSTNAME="ircserver.fakeHostname";
|
||||
public static final String PROP_HOSTNAME_DEFAULT="%f.b32.i2p";
|
||||
|
||||
@ -67,7 +77,20 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
|
||||
/** generate a random 32 bytes, or the hash of the passphrase */
|
||||
private void initCloak(I2PTunnel tunnel) {
|
||||
// get the properties of this server-tunnel
|
||||
Properties opts = tunnel.getClientOptions();
|
||||
|
||||
// get method of host faking
|
||||
this.method = opts.getProperty(PROP_METHOD, PROP_METHOD_DEFAULT);
|
||||
assert this.method != null;
|
||||
|
||||
// get the password for the webirc method
|
||||
this.webircPassword = opts.getProperty(PROP_WEBIRC_PASSWORD);
|
||||
|
||||
// get the spoof IP for the webirc method
|
||||
this.webircSpoofIP = opts.getProperty(PROP_WEBIRC_SPOOF_IP, PROP_WEBIRC_SPOOF_IP_DEFAULT);
|
||||
|
||||
// get the cloaking passphrase
|
||||
String passphrase = opts.getProperty(PROP_CLOAK);
|
||||
if (passphrase == null) {
|
||||
this.cloakKey = new byte[Hash.HASH_LENGTH];
|
||||
@ -76,17 +99,30 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
this.cloakKey = SHA256Generator.getInstance().calculateHash(passphrase.trim().getBytes()).getData();
|
||||
}
|
||||
|
||||
// get the fake hostmask to use
|
||||
this.hostname = opts.getProperty(PROP_HOSTNAME, PROP_HOSTNAME_DEFAULT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void blockingHandle(I2PSocket socket) {
|
||||
try {
|
||||
String modifiedRegistration;
|
||||
if(!this.method.equals("webirc")) {
|
||||
// give them 15 seconds to send in the request
|
||||
socket.setReadTimeout(15*1000);
|
||||
InputStream in = socket.getInputStream();
|
||||
String modifiedRegistration = filterRegistration(in, cloakDest(socket.getPeerDestination()));
|
||||
modifiedRegistration = filterRegistration(in, cloakDest(socket.getPeerDestination()));
|
||||
socket.setReadTimeout(readTimeout);
|
||||
} else {
|
||||
StringBuffer buf = new StringBuffer("WEBIRC ");
|
||||
buf.append(this.webircPassword);
|
||||
buf.append(" cgiirc ");
|
||||
buf.append(cloakDest(socket.getPeerDestination()));
|
||||
buf.append(' ');
|
||||
buf.append(this.webircSpoofIP);
|
||||
buf.append("\r\n");
|
||||
modifiedRegistration = buf.toString();
|
||||
}
|
||||
Socket s = new Socket(remoteHost, remotePort);
|
||||
new I2PTunnelRunner(s, socket, slock, null, modifiedRegistration.getBytes(), null);
|
||||
} catch (SocketException ex) {
|
||||
@ -134,7 +170,7 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
}
|
||||
|
||||
/** keep reading until we see USER or SERVER */
|
||||
private String filterRegistration(InputStream in, String newHostname) throws IOException {
|
||||
private static String filterRegistration(InputStream in, String newHostname) throws IOException {
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
int lineCount = 0;
|
||||
|
||||
@ -185,4 +221,7 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
|
||||
private byte[] cloakKey; // 32 bytes of stuff to scramble the dest with
|
||||
private String hostname;
|
||||
private String method;
|
||||
private String webircPassword;
|
||||
private String webircSpoofIP;
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.data.ByteArray;
|
||||
import net.i2p.util.ByteCache;
|
||||
import net.i2p.util.Clock;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class I2PTunnelRunner extends I2PThread implements I2PSocket.SocketErrorListener {
|
||||
public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErrorListener {
|
||||
private final static Log _log = new Log(I2PTunnelRunner.class);
|
||||
|
||||
private static volatile long __runnerId;
|
||||
@ -124,11 +124,14 @@ public class I2PTunnelRunner extends I2PThread implements I2PSocket.SocketErrorL
|
||||
OutputStream i2pout = i2ps.getOutputStream(); //new BufferedOutputStream(i2ps.getOutputStream(), MAX_PACKET_SIZE);
|
||||
if (initialI2PData != null) {
|
||||
synchronized (slock) {
|
||||
// this does not increment totalSent
|
||||
i2pout.write(initialI2PData);
|
||||
// do NOT flush here, it will block and then onTimeout.run() won't happen on fail.
|
||||
//i2pout.flush();
|
||||
}
|
||||
}
|
||||
if (initialSocketData != null) {
|
||||
// this does not increment totalReceived
|
||||
out.write(initialSocketData);
|
||||
}
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
@ -150,6 +153,7 @@ public class I2PTunnelRunner extends I2PThread implements I2PSocket.SocketErrorL
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("runner has a timeout job, totalReceived = " + totalReceived
|
||||
+ " totalSent = " + totalSent + " job = " + onTimeout);
|
||||
// should we only look at totalReceived?
|
||||
if ( (totalSent <= 0) && (totalReceived <= 0) )
|
||||
onTimeout.run();
|
||||
}
|
||||
@ -222,7 +226,7 @@ public class I2PTunnelRunner extends I2PThread implements I2PSocket.SocketErrorL
|
||||
}
|
||||
}
|
||||
|
||||
private class StreamForwarder extends I2PThread {
|
||||
private class StreamForwarder extends I2PAppThread {
|
||||
|
||||
InputStream in;
|
||||
OutputStream out;
|
||||
@ -271,7 +275,7 @@ public class I2PTunnelRunner extends I2PThread implements I2PSocket.SocketErrorL
|
||||
//if (_log.shouldLog(Log.DEBUG))
|
||||
// _log.debug("Flushing after sending " + len + " bytes through");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(direction + ": " + len + " bytes flushed through to "
|
||||
_log.debug(direction + ": " + len + " bytes flushed through " + (_toI2P ? "to " : "from ")
|
||||
+ i2ps.getPeerDestination().calculateHash().toBase64().substring(0,6));
|
||||
try {
|
||||
Thread.sleep(I2PTunnel.PACKET_DELAY);
|
||||
|
@ -4,6 +4,7 @@
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@ -24,7 +25,7 @@ import net.i2p.client.streaming.I2PSocketManager;
|
||||
import net.i2p.client.streaming.I2PSocketManagerFactory;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
@ -48,26 +49,29 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
protected long readTimeout = DEFAULT_READ_TIMEOUT;
|
||||
|
||||
private static final boolean DEFAULT_USE_POOL = false;
|
||||
protected static volatile long __serverId = 0;
|
||||
private static final String PROP_HANDLER_COUNT = "i2ptunnel.blockingHandlerCount";
|
||||
private static final int DEFAULT_HANDLER_COUNT = 10;
|
||||
|
||||
|
||||
|
||||
protected I2PTunnelTask task = null;
|
||||
protected boolean bidir = false;
|
||||
|
||||
private int DEFAULT_LOCALPORT = 4488;
|
||||
protected int localPort = DEFAULT_LOCALPORT;
|
||||
|
||||
public I2PTunnelServer(InetAddress host, int port, String privData, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host + ":" + port + " <- " + privData, notifyThis, tunnel);
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decode(privData));
|
||||
String usePool = tunnel.getClientOptions().getProperty("i2ptunnel.usePool");
|
||||
if (usePool != null)
|
||||
_usePool = "true".equalsIgnoreCase(usePool);
|
||||
else
|
||||
_usePool = DEFAULT_USE_POOL;
|
||||
SetUsePool(tunnel);
|
||||
init(host, port, bais, privData, l);
|
||||
}
|
||||
|
||||
public I2PTunnelServer(InetAddress host, int port, File privkey, String privkeyname, Logging l,
|
||||
EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host + ":" + port + " <- " + privkeyname, notifyThis, tunnel);
|
||||
String usePool = tunnel.getClientOptions().getProperty("i2ptunnel.usePool");
|
||||
if (usePool != null)
|
||||
_usePool = "true".equalsIgnoreCase(usePool);
|
||||
else
|
||||
_usePool = DEFAULT_USE_POOL;
|
||||
SetUsePool(tunnel);
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(privkey);
|
||||
@ -83,12 +87,17 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
|
||||
public I2PTunnelServer(InetAddress host, int port, InputStream privData, String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(host + ":" + port + " <- " + privkeyname, notifyThis, tunnel);
|
||||
String usePool = tunnel.getClientOptions().getProperty("i2ptunnel.usePool");
|
||||
SetUsePool(tunnel);
|
||||
init(host, port, privData, privkeyname, l);
|
||||
}
|
||||
|
||||
|
||||
private void SetUsePool(I2PTunnel Tunnel) {
|
||||
String usePool = Tunnel.getClientOptions().getProperty("i2ptunnel.usePool");
|
||||
if (usePool != null)
|
||||
_usePool = "true".equalsIgnoreCase(usePool);
|
||||
else
|
||||
_usePool = DEFAULT_USE_POOL;
|
||||
init(host, port, privData, privkeyname, l);
|
||||
}
|
||||
|
||||
private void init(InetAddress host, int port, InputStream privData, String privkeyname, Logging l) {
|
||||
@ -106,17 +115,29 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
// copy the privData to a new BAIS, so we can always reset() it if we have to retry
|
||||
ByteArrayInputStream privDataCopy;
|
||||
try {
|
||||
privDataCopy = copyOfInputStream(privData);
|
||||
} catch (IOException ioe) {
|
||||
_log.log(Log.CRIT, "Cannot read private key data for " + privkeyname, ioe);
|
||||
return;
|
||||
}
|
||||
|
||||
// Todo: Can't stop a tunnel from the UI while it's in this loop (no session yet)
|
||||
while (sockMgr == null) {
|
||||
synchronized (slock) {
|
||||
sockMgr = I2PSocketManagerFactory.createManager(privData, getTunnel().host, portNum,
|
||||
sockMgr = I2PSocketManagerFactory.createManager(privDataCopy, getTunnel().host, portNum,
|
||||
props);
|
||||
|
||||
}
|
||||
if (sockMgr == null) {
|
||||
_log.log(Log.CRIT, "Unable to create socket manager");
|
||||
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
|
||||
privDataCopy.reset();
|
||||
}
|
||||
}
|
||||
|
||||
sockMgr.setName("Server");
|
||||
getTunnel().addSession(sockMgr.getSession());
|
||||
l.log("Ready!");
|
||||
@ -124,15 +145,31 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
open = true;
|
||||
}
|
||||
|
||||
|
||||
private static volatile long __serverId = 0;
|
||||
/**
|
||||
* Copy input stream to a byte array, so we can retry
|
||||
* @since 0.7.10
|
||||
*/
|
||||
private static ByteArrayInputStream copyOfInputStream(InputStream is) throws IOException {
|
||||
byte[] buf = new byte[128];
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(768);
|
||||
try {
|
||||
int read;
|
||||
while ((read = is.read(buf)) >= 0) {
|
||||
os.write(buf, 0, read);
|
||||
}
|
||||
} finally {
|
||||
try { is.close(); } catch (IOException ioe) {}
|
||||
// don't need to close BAOS
|
||||
}
|
||||
return new ByteArrayInputStream(os.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* Start running the I2PTunnelServer.
|
||||
*
|
||||
*/
|
||||
public void startRunning() {
|
||||
Thread t = new I2PThread(this);
|
||||
Thread t = new I2PAppThread(this);
|
||||
t.setName("Server " + (++__serverId));
|
||||
t.start();
|
||||
}
|
||||
@ -158,6 +195,9 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
|
||||
public boolean close(boolean forced) {
|
||||
if (!open) return true;
|
||||
if (task != null) {
|
||||
task.close(forced);
|
||||
}
|
||||
synchronized (lock) {
|
||||
if (!forced && sockMgr.listSockets().size() != 0) {
|
||||
l.log("There are still active connections!");
|
||||
@ -173,7 +213,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
sockMgr.getSession().destroySession();
|
||||
} catch (I2PException ex) {
|
||||
_log.error("Error destroying the session", ex);
|
||||
System.exit(1);
|
||||
//System.exit(1);
|
||||
}
|
||||
l.log("Server shut down.");
|
||||
open = false;
|
||||
@ -181,9 +221,6 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private static final String PROP_HANDLER_COUNT = "i2ptunnel.blockingHandlerCount";
|
||||
private static final int DEFAULT_HANDLER_COUNT = 10;
|
||||
|
||||
protected int getHandlerCount() {
|
||||
int rv = DEFAULT_HANDLER_COUNT;
|
||||
String cnt = getTunnel().getClientOptions().getProperty(PROP_HANDLER_COUNT);
|
||||
@ -204,7 +241,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
I2PServerSocket i2pS_S = sockMgr.getServerSocket();
|
||||
int handlers = getHandlerCount();
|
||||
for (int i = 0; i < handlers; i++) {
|
||||
I2PThread handler = new I2PThread(new Handler(i2pS_S), "Handle Server " + i);
|
||||
I2PAppThread handler = new I2PAppThread(new Handler(i2pS_S), "Handle Server " + i);
|
||||
handler.start();
|
||||
}
|
||||
} else {
|
||||
@ -213,7 +250,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
try {
|
||||
final I2PSocket i2ps = i2pS_S.accept();
|
||||
if (i2ps == null) throw new I2PException("I2PServerSocket closed");
|
||||
new I2PThread(new Runnable() { public void run() { blockingHandle(i2ps); } }).start();
|
||||
new I2PAppThread(new Runnable() { public void run() { blockingHandle(i2ps); } }).start();
|
||||
} catch (I2PException ipe) {
|
||||
if (_log.shouldLog(Log.ERROR))
|
||||
_log.error("Error accepting - KILLING THE TUNNEL SERVER", ipe);
|
||||
@ -257,6 +294,8 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
}
|
||||
|
||||
protected void blockingHandle(I2PSocket socket) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Incoming connection to '" + toString() + "' from: " + socket.getPeerDestination().calculateHash().toBase64());
|
||||
long afterAccept = I2PAppContext.getGlobalContext().clock().now();
|
||||
long afterSocket = -1;
|
||||
//local is fast, so synchronously. Does not need that many
|
||||
|
@ -14,7 +14,7 @@ import net.i2p.I2PException;
|
||||
import net.i2p.client.streaming.I2PSocketManager;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.EventDispatcher;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class I2Ping extends I2PTunnelTask implements Runnable {
|
||||
@ -59,7 +59,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable {
|
||||
sockMgr = I2PTunnelClient.getSocketManager(tunnel);
|
||||
}
|
||||
}
|
||||
Thread t = new I2PThread(this);
|
||||
Thread t = new I2PAppThread(this);
|
||||
t.setName("Client");
|
||||
t.start();
|
||||
open = true;
|
||||
@ -188,7 +188,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public class PingHandler extends I2PThread {
|
||||
public class PingHandler extends I2PAppThread {
|
||||
private String destination;
|
||||
|
||||
public PingHandler(String dest) {
|
||||
|
@ -0,0 +1,56 @@
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.InternalServerSocket;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Listen for in-JVM connections on the internal "socket"
|
||||
*
|
||||
* @author zzz
|
||||
* @since 0.7.9
|
||||
*/
|
||||
class InternalSocketRunner implements Runnable {
|
||||
private I2PTunnelClientBase client;
|
||||
private int port;
|
||||
private ServerSocket ss;
|
||||
private boolean open;
|
||||
private static final Log _log = new Log(InternalSocketRunner.class);
|
||||
|
||||
/** starts the runner */
|
||||
InternalSocketRunner(I2PTunnelClientBase client) {
|
||||
this.client = client;
|
||||
this.port = client.getLocalPort();
|
||||
Thread t = new I2PAppThread(this, "Internal socket port " + this.port, true);
|
||||
t.start();
|
||||
}
|
||||
|
||||
public final void run() {
|
||||
try {
|
||||
this.ss = new InternalServerSocket(this.port);
|
||||
this.open = true;
|
||||
while (true) {
|
||||
Socket s = this.ss.accept();
|
||||
this.client.manageConnection(s);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
if (this.open) {
|
||||
_log.error("Error listening for internal connections on " + this.port, ex);
|
||||
}
|
||||
this.open = false;
|
||||
}
|
||||
}
|
||||
|
||||
void stopRunning() {
|
||||
if (this.open) {
|
||||
try {
|
||||
this.ss.close();
|
||||
} catch (IOException ex) {}
|
||||
this.open = false;
|
||||
}
|
||||
}
|
||||
}
|