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

Modified Files:
        Main.java Node.java 
Log Message:
6277:
Disable outbound request based limiting by default.
Make requestDataNotFound a counting diagnostic process, not continuous.
Reject requests from 6275 and earlier.


Index: Main.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Main.java,v
retrieving revision 1.279
retrieving revision 1.280
diff -u -w -r1.279 -r1.280
--- Main.java   24 Oct 2003 04:27:09 -0000      1.279
+++ Main.java   24 Oct 2003 19:38:19 -0000      1.280
@@ -2068,7 +2068,7 @@
         d.registerBinomial("routingSuccessRatio", d.MINUTE,
                            "Requests that failed or succeeded by routing, "+
                            "and the number that succeeded.", messages);
-        d.registerContinuous("requestDataNotFound", d.MINUTE,
+        d.registerCounting("requestDataNotFound", d.MINUTE,
                              "Requests that failed due to DataNotFound",
                              messages);
         d.registerBinomial("receivedData", d.MINUTE,

Index: Node.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Node.java,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -w -r1.228 -r1.229
--- Node.java   22 Oct 2003 22:07:14 -0000      1.228
+++ Node.java   24 Oct 2003 19:38:19 -0000      1.229
@@ -126,7 +126,7 @@
                config.addOption("maxConnectionsPerMinute", 1, 60,  1226);
                config.addOption("maxConnectionsMinute", 1, 60000,  1227);
         // these, and increasing the default quite a bit while at it.
-        config.addOption("maxRequestsPerInterval", 1, 300, 1228);
+        config.addOption("maxRequestsPerInterval", 1, -1, 1228);
         config.addOption("maxRequestsInterval", 1, 60000, 1229);
         // data store settings
         config.addOption("storeType",        1, "freenet",     999);  // "freenet" or 
"native"
@@ -652,7 +652,7 @@
                config.setExpert ("maxRequestsPerInterval", true);
                config.argDesc   ("maxRequestsPerInterval", "<int>");
         config.shortDesc ("maxRequestsPerInterval", "Max no. of outgoing requests per 
maxRequestsInterval.");
-        config.longDesc  ("maxRequestsPerInterval", "The maximum number of outgoing 
requests per maxRequestsInterval.");
+        config.longDesc  ("maxRequestsPerInterval", "The maximum number of outgoing 
requests per maxRequestsInterval. -1 = disable.");
        
                // maxRequestsInterval
                config.setExpert ("maxRequestsInterval", true);
@@ -1976,9 +1976,10 @@
         initialRequests = params.getInt("initialRequests");
         initialRequestHTL = params.getInt("initialRequestHTL");
         //maxForwardTries    = Defaults.getInt("maxForwardTries", params);
-               outboundRequestLimit = new LimitCounter(
-                                                                                      
         params.getInt("maxRequestsInterval"), 
-                                                                                      
         params.getInt("maxRequestsPerInterval"));
+               int maxRequestsPerInterval = params.getInt("maxRequestsPerInterval");
+               if(maxRequestsPerInterval > 0)
+                       outboundRequestLimit = new 
LimitCounter(params.getInt("maxRequestsInterval"), 
+                                                                                      
                 maxRequestsPerInterval);
        
                lowLevelBWLimitFudgeFactor = 
params.getFloat("lowLevelBWLimitFudgeFactor");
                lowLevelBWLimitMultiplier = 
params.getFloat("lowLevelBWLimitMultiplier") *
@@ -2484,7 +2485,7 @@
      * @return true if the Node is QueryRejecting inbound requests, false otherwise.
      **/
     public boolean rejectingRequests() {
-        if (outboundRequestLimit.exceeded()) {
+        if (outboundRequestLimit != null && outboundRequestLimit.exceeded()) {
             return true;
         }
 
@@ -2575,7 +2576,8 @@
     public final float estimatedLoad() {
                double ret;
                
-               if(outboundRequestLimit.exceeded()) return 1.0F;
+               if(outboundRequestLimit != null &&
+                  outboundRequestLimit.exceeded()) return 1.0F;
                
         int maximumThreads = threadFactory.maximumThreads();
                
@@ -2662,7 +2664,7 @@
 
                float load = estimatedLoad();
 
-        if ((!outboundRequestLimit.exceeded())  &&
+        if ((outboundRequestLimit == null || (!outboundRequestLimit.exceeded()))  &&
                        load < overloadLow) {
             if (inboundRequests != null) {
                 inboundRequests.incSuccesses(diagAddr);

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

Reply via email to