* Cache DNS and negative DNS for 5m (was 1m and forever)

* Delay shitlist cleaner at startup
    * Strip wrapper properties from client config
    * Define multiple cert type
    * Prohibit negative maxSends in streaming
    * HTML fixup on configtunnels.jsp
    * Increase wrapper exit timeout from default 15s to 30s
This commit is contained in:
zzz
2008-11-21 16:29:16 +00:00
parent 93f0092437
commit 4e5825c648
10 changed files with 53 additions and 29 deletions

View File

@@ -81,12 +81,15 @@ public class Router {
public final static String PROP_KEYS_FILENAME = "router.keys.location";
public final static String PROP_KEYS_FILENAME_DEFAULT = "router.keys";
public final static String PROP_SHUTDOWN_IN_PROGRESS = "__shutdownInProgress";
public final static String DNS_CACHE_TIME = "" + (5*60);
static {
// grumble about sun's java caching DNS entries *forever* by default
// so lets just keep 'em for a minute
System.setProperty("sun.net.inetaddr.ttl", "60");
System.setProperty("networkaddress.cache.ttl", "60");
// so lets just keep 'em for a short time
System.setProperty("sun.net.inetaddr.ttl", DNS_CACHE_TIME);
System.setProperty("sun.net.inetaddr.negative.ttl", DNS_CACHE_TIME);
System.setProperty("networkaddress.cache.ttl", DNS_CACHE_TIME);
System.setProperty("networkaddress.cache.negative.ttl", DNS_CACHE_TIME);
// until we handle restricted routes and/or all peers support v6, try v4 first
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("http.agent", "I2P");

View File

@@ -49,6 +49,7 @@ public class Shitlist {
public final static long SHITLIST_DURATION_MAX = 60*60*1000;
public final static long SHITLIST_DURATION_PARTIAL = 20*60*1000;
public final static long SHITLIST_DURATION_FOREVER = 181l*24*60*60*1000; // will get rounded down to 180d on console
public final static long SHITLIST_CLEANER_START_DELAY = SHITLIST_DURATION_PARTIAL;
public Shitlist(RouterContext context) {
_context = context;
@@ -62,6 +63,7 @@ public class Shitlist {
public Cleanup(RouterContext ctx) {
super(ctx);
_toUnshitlist = new ArrayList(4);
getTiming().setStartAfter(_context.clock().now() + SHITLIST_CLEANER_START_DELAY);
}
public String getName() { return "Cleanup shitlist"; }
public void runJob() {