Update of /cvsroot/freenet/freenet/src/freenet/node/states/FNP
In directory sc8-pr-cvs1:/tmp/cvs-serv23667/src/freenet/node/states/FNP

Modified Files:
        NewDataRequest.java.BlackHole 
Log Message:
slightly smarter black hole, more work to follow

Index: NewDataRequest.java.BlackHole
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/FNP/NewDataRequest.java.BlackHole,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- NewDataRequest.java.BlackHole       29 Nov 2003 04:30:38 -0000      1.1
+++ NewDataRequest.java.BlackHole       4 Dec 2003 19:49:17 -0000       1.2
@@ -13,6 +13,12 @@
 
 public class NewDataRequest extends NewRequest {
 
+       //the probability with which to DNF incoming requests.
+       //the current implementation simply stalls queries which
+       //are not dnf'd; it is trivial to make it route them
+       //(just copy the code from the original ;-))
+       final static double pDNF=1.0; 
+
     public NewDataRequest(long id) {
         super(id);
     }
@@ -36,9 +42,11 @@
            Core.diagnostics.occurrenceCounting("incomingRequests", 1);     
            //send back a DNF immediately, on same thread, without callback
 
+               if (Math.random() <= pDNF) {
            Message m = new DataNotFound(drmo.id());
            n.sendMessageAsync(m, drmo.getSource(), PeerHandler.EXPENDABLE,
                               null);
+               }
            return null;
         } catch (RequestAbortException e) {
             return e.state;

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to