diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java index aa9dea2c25f22575f4939b247be3925b6be4db03..b9e012d7e8513bb6358f3686a8d13f6360a14df4 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java @@ -234,7 +234,10 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { try { _filter = FilterFactory.createFilter(context, filterDefinition); } catch (IOException | InvalidDefinitionException bad) { - throw new IllegalArgumentException("Bad filter definition file: " + bad.getMessage(), bad); + String msg = "Bad filter definition file: " + filterDefinition + " - filtering disabled: " + bad.getMessage(); + _log.error(msg, bad); + l.log(msg); + _filter = null; } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/AccessFilter.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/AccessFilter.java index 698bb1edb94f6a1ee8dd3a256c765f60c6716f27..bd0cba39169d54b584e8b573632268f6f2c48c32 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/AccessFilter.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/AccessFilter.java @@ -236,7 +236,7 @@ class AccessFilter implements StatefulConnectionFilter { syncer.schedule(SYNC_INTERVAL); } catch (IOException bad) { Log log = context.logManager().getLog(AccessFilter.class); - log.log(Log.CRIT, "syncing access list failed", bad); + log.error("syncing access list failed", bad); } } }); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/FileFilterDefinitionElement.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/FileFilterDefinitionElement.java index cbeedac7eb86b9b963f32c589ae090667e2469f8..b6976060c2b45e2d06120bc04edcf25a5196ea7e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/FileFilterDefinitionElement.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/FileFilterDefinitionElement.java @@ -8,7 +8,9 @@ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; +import net.i2p.I2PAppContext; import net.i2p.data.Hash; +import net.i2p.util.Log; /** * An element of filter definition that reads hashes of remote destinations @@ -55,7 +57,16 @@ class FileFilterDefinitionElement extends FilterDefinitionElement { reader = new BufferedReader(new FileReader(file)); String b32; while((b32 = reader.readLine()) != null) { - Hash hash = fromBase32(b32); + if (b32.length() == 0) + continue; + Hash hash; + try { + hash = fromBase32(b32); + } catch (InvalidDefinitionException bad32) { + Log log = I2PAppContext.getGlobalContext().logManager().getLog(FileFilterDefinitionElement.class); + log.error("Invalid access list entry \"" + b32 + "\" in " + file, bad32); + continue; + } if (map.containsKey(hash)) continue; DestTracker newTracker = new DestTracker(hash, threshold); @@ -64,8 +75,6 @@ class FileFilterDefinitionElement extends FilterDefinitionElement { lastLoaded.put(hash, newTracker); } } - } catch (InvalidDefinitionException bad32) { - throw new IOException("invalid access list entry", bad32); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) {}