From e6da9cbba8c239b58ef73aa7194dfa62a59127cd Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 4 Feb 2015 08:50:52 +0000 Subject: [PATCH] Manually reset the networkaddress.cache.ttl value to the defaults (Fixes #1268) When searching for the networkaddress.cache.* values java will default to these values when it can't find a manually set value, however if a security manager is in place then as a special case java will set the cache lifetime to infinite. Manually setting the values solves this issue. --- .../src/main/java/net/md_5/bungee/BungeeCordLauncher.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/bootstrap/src/main/java/net/md_5/bungee/BungeeCordLauncher.java index 8ab08cf7..68f104b8 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/bootstrap/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -1,5 +1,6 @@ package net.md_5.bungee; +import java.security.Security; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Calendar; @@ -16,6 +17,9 @@ public class BungeeCordLauncher public static void main(String[] args) throws Exception { + Security.setProperty( "networkaddress.cache.ttl", "30" ); + Security.setProperty( "networkaddress.cache.negative.ttl", "10" ); + OptionParser parser = new OptionParser(); parser.allowsUnrecognizedOptions(); parser.acceptsAll( Arrays.asList( "v", "version" ) );