Author: toad
Date: 2008-02-09 14:24:56 +0000 (Sat, 09 Feb 2008)
New Revision: 17749

Modified:
   trunk/freenet/src/freenet/node/NetworkIDManager.java
Log:
Turn off support for responding to or handling secret-pings if the disable flag 
is set.
Which it is at the moment.
I'm very happy to have this prototyping code in the node, but it must not 
affect normal operation until we are *SURE* that it works, doesn't DoS the 
network, and I understand it a bit better!
It probably won't be enabled in 0.7.0, but we'll see.

Modified: trunk/freenet/src/freenet/node/NetworkIDManager.java
===================================================================
--- trunk/freenet/src/freenet/node/NetworkIDManager.java        2008-02-09 
13:44:10 UTC (rev 17748)
+++ trunk/freenet/src/freenet/node/NetworkIDManager.java        2008-02-09 
14:24:56 UTC (rev 17749)
@@ -88,6 +88,7 @@
         * that they may be asked for the secret from a third party.
         */
        public boolean handleStoreSecret(Message m) {
+               if(disableSecretPings) return true;
                PeerNode pn=(PeerNode)m.getSource();
                long uid = m.getLong(DMT.UID);
                long secret = m.getLong(DMT.SECRET);
@@ -103,6 +104,7 @@
        }

        public boolean handleSecretPing(final Message m) {
+               if(disableSecretPings) return true;
                final PeerNode source=(PeerNode)m.getSource();
                final long uid = m.getLong(DMT.UID);
                final short htl = m.getShort(DMT.HTL);


Reply via email to