I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 4da8a912 authored by zzz's avatar zzz
Browse files

CLI: Don't die on reseed test if one entry is bad

parent ca22f3db
No related branches found
No related tags found
No related merge requests found
Pipeline #2206 failed
......@@ -22,6 +22,7 @@ import java.util.StringTokenizer;
import net.i2p.I2PAppContext;
import net.i2p.crypto.SU3File;
import net.i2p.data.Base64;
import net.i2p.data.DataFormatException;
import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.data.router.RouterInfo;
......@@ -1288,14 +1289,21 @@ public class Reseeder {
throw new IOException("su3 file too old");
java.util.zip.ZipFile zipf = new java.util.zip.ZipFile(zip);
java.util.Enumeration<? extends java.util.zip.ZipEntry> entries = zipf.entries();
int ri = 0, old = 0;
int ri = 0, old = 0, bad = 0;
int oldver = 0, unreach = 0;
while (entries.hasMoreElements()) {
java.util.zip.ZipEntry entry = (java.util.zip.ZipEntry) entries.nextElement();
RouterInfo r = new RouterInfo();
InputStream in = zipf.getInputStream(entry);
r.readBytes(in);
in.close();
try {
r.readBytes(in);
} catch (DataFormatException dfe) {
System.out.println("Bad entry " + entry.getName() + ": " + dfe);
bad++;
continue;
} finally {
in.close();
}
if (r.getPublished() > cutoff)
ri++;
else
......@@ -1306,6 +1314,8 @@ public class Reseeder {
unreach++;
}
zipf.close();
if (bad > 0)
System.out.println(bad + " bad entries");
if (old > 0) {
System.out.println("Test failed for " + host + ", returned " + old + " old router infos");
fail++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment