Author: nextgens
Date: 2006-07-09 14:06:00 +0000 (Sun, 09 Jul 2006)
New Revision: 9520

Modified:
   trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
Log:
Prevent the node from starting if fproxy's port can't be bound insteed of 
silently disabling the web-interface

Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2006-07-09 
09:01:43 UTC (rev 9519)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2006-07-09 
14:06:00 UTC (rev 9520)
@@ -4,6 +4,7 @@
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.net.BindException;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -368,7 +369,11 @@
                        // Now start the server.
                        server.start();

-               } catch (IOException ioe) {
+               }catch (BindException e){
+                       Logger.error(node,"Failed to start FProxy port already 
bound: isn't freenet already running ?");
+                       System.err.println("Failed to start FProxy port already 
bound: isn't freenet already running ?");
+                       throw new InvalidConfigValueException("Can't bind 
fproxy on that port!");
+               }catch (IOException ioe) {
                        Logger.error(node,"Failed to start FProxy: "+ioe, ioe);
                }



Reply via email to