Author: nextgens
Date: 2006-06-17 22:29:03 +0000 (Sat, 17 Jun 2006)
New Revision: 9279
Modified:
trunk/freenet/src/freenet/clients/http/QueueToadlet.java
trunk/freenet/src/freenet/node/fcp/FCPServer.java
Log:
prevents a npe if the FCP server is disabled and the /queue/ page requested
Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2006-06-17
22:18:02 UTC (rev 9278)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2006-06-17
22:29:03 UTC (rev 9279)
@@ -97,6 +97,12 @@
public void handleGet(URI uri, ToadletContext ctx)
throws ToadletContextClosedException, IOException, RedirectException {
+ // We ensure that we have a FCP server running
+ if(!fcp.enabled){
+ this.writeReply(ctx, 400, "text/plain", "FCP server is
missing", "You need to enable the FCP server to access this page");
+ return;
+ }
+
StringBuffer buf = new StringBuffer(2048);
// First, get the queued requests, and separate them into
different types.
Modified: trunk/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-06-17 22:18:02 UTC
(rev 9278)
+++ trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-06-17 22:29:03 UTC
(rev 9279)
@@ -43,7 +43,7 @@
final NetworkInterface networkInterface;
final Node node;
final int port;
- final boolean enabled;
+ public final boolean enabled;
final String bindTo;
String allowedHosts;
final WeakHashMap clientsByName;