Author: nextgens
Date: 2007-11-19 14:02:50 +0000 (Mon, 19 Nov 2007)
New Revision: 15823

Modified:
   trunk/freenet/src/freenet/io/AllowedHosts.java
   trunk/freenet/src/freenet/io/NetworkInterface.java
Log:
NetworkInterface: fallback to the DEFAULT_BINDTO if the configuration file is 
broken

Modified: trunk/freenet/src/freenet/io/AllowedHosts.java
===================================================================
--- trunk/freenet/src/freenet/io/AllowedHosts.java      2007-11-19 13:27:50 UTC 
(rev 15822)
+++ trunk/freenet/src/freenet/io/AllowedHosts.java      2007-11-19 14:02:50 UTC 
(rev 15823)
@@ -40,6 +40,7 @@
         *            The new list of allowed hosts s
         */
        public void setAllowedHosts(String allowedHosts) {
+                if(allowedHosts == null || allowedHosts.equals("")) 
allowedHosts = NetworkInterface.DEFAULT_BIND_TO;
                StringTokenizer allowedHostsTokens = new 
StringTokenizer(allowedHosts, ",");
                List newAddressMatchers = new ArrayList();
                while (allowedHostsTokens.hasMoreTokens()) {

Modified: trunk/freenet/src/freenet/io/NetworkInterface.java
===================================================================
--- trunk/freenet/src/freenet/io/NetworkInterface.java  2007-11-19 13:27:50 UTC 
(rev 15822)
+++ trunk/freenet/src/freenet/io/NetworkInterface.java  2007-11-19 14:02:50 UTC 
(rev 15823)
@@ -108,6 +108,7 @@
         *            A comma-separated list of IP address to bind to
         */
        public void setBindTo(String bindTo, boolean ignoreUnbindable) throws 
IOException {
+                if(bindTo == null || bindTo.equals("")) bindTo = 
NetworkInterface.DEFAULT_BIND_TO;
                StringTokenizer bindToTokens = new StringTokenizer(bindTo, ",");
                List bindToTokenList = new ArrayList();
                while (bindToTokens.hasMoreTokens()) {


Reply via email to