Fix bencoded scrape response for zzzot (ticket #1994)

requires I2P 0.9.30-8
This commit is contained in:
zzz
2017-05-21 18:45:24 +00:00
parent a39186cfff
commit c2482d68c8
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,7 @@
0.16.0
2017-05-21
Fix scrape response (requires I2P 0.9.30-8) (ticket #1994)
0.15.0
2017-03-11
Increase default limits, set I2CP tag options

View File

@ -16,7 +16,7 @@
<delete dir="plugin/eepsite/docroot/torrents/" />
<!-- get version number -->
<buildnumber file="scripts/build.number" />
<property name="release.number" value="0.15.0" />
<property name="release.number" value="0.16.0" />
<!-- make the update xpi2p -->
<!-- this contains everything except i2ptunnel.config -->

View File

@ -77,7 +77,8 @@
ihList.addAll(torrents.keySet());
else
ihList.add(ih);
Map<String, Map> files = new HashMap<String, Map>();
// requires I2P 0.9.30-8
Map<byte[], Map> files = new HashMap<byte[], Map>();
for (InfoHash ihash : ihList) {
Peers peers = torrents.get(ihash);
if (peers == null)
@ -88,11 +89,16 @@
dict.put("complete", Integer.valueOf(seeds));
dict.put("incomplete", Integer.valueOf(size - seeds));
dict.put("downloaded", Integer.valueOf(0));
files.put(new String(ihash.getData(), "ISO-8859-1"), dict);
files.put(ihash.getData(), dict);
}
m.put("files", files);
}
BEncoder.bencode(m, cout);
try {
BEncoder.bencode(m, cout);
} catch (IllegalArgumentException iae) {
// before I2P 0.9.30-8
// just let it truncate, wasn't valid before anyway
}
/*
* Remove the newline on the last line or