Author: toad
Date: 2006-10-27 16:03:32 +0000 (Fri, 27 Oct 2006)
New Revision: 10711

Modified:
   trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
Log:
Fix node removal.

Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2006-10-26 22:56:46 UTC (rev 10710)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2006-10-27 16:03:32 UTC (rev 10711)
@@ -772,7 +772,7 @@
                        PeerNode[] peerNodes = node.getDarknetConnections();
                        for(int i = 0; i < peerNodes.length; i++) {
                                if 
(request.isPartSet("node_"+peerNodes[i].hashCode())) {       
-                                       
if((peerNodes[i].timeLastConnectionCompleted() < (System.currentTimeMillis() - 
1000*60*60*24*7) /* one week */) ||  (peerNodes[i].peerNodeStatus == 
Node.PEER_NODE_STATUS_NEVER_CONNECTED)){
+                                       
if((peerNodes[i].timeLastConnectionCompleted() < (System.currentTimeMillis() - 
1000*60*60*24*7) /* one week */) ||  (peerNodes[i].peerNodeStatus == 
Node.PEER_NODE_STATUS_NEVER_CONNECTED) || request.isPartSet("forceit")){
                                                
this.node.removeDarknetConnection(peerNodes[i]);
                                                if(logMINOR) Logger.minor(this, 
"Removed node: node_"+peerNodes[i].hashCode());
                                        }else{
@@ -786,6 +786,7 @@
                                                removeForm.addChild("input", 
new String[] { "type", "name", "value" }, new String[] { "hidden", 
"node_"+peerNodes[i].hashCode(), "remove" });
                                                removeForm.addChild("input", 
new String[] { "type", "name", "value" }, new String[] { "submit", "cancel", 
"Cancel" });
                                                removeForm.addChild("input", 
new String[] { "type", "name", "value" }, new String[] { "submit", "remove", 
"Remove it!" });
+                                               removeForm.addChild("input", 
new String[] { "type", "name" }, new String[] { "hidden", "forceit", "Force" });
                                                writeReply(ctx, 200, 
"text/html", "OK", pageNode.generate());
                                                return; // FIXME: maybe it 
breaks multi-node removing
                                        }                               


Reply via email to