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

Modified Files:
        Node.java 
Log Message:
6296:
A few more Eclipse warning fixes, slightly functional this time - use our built-in URL 
codecs, rather than the deprecated java ones, for example, and catch their exceptions.
Add support for deprecated options - which won't be written out when generating a 
config, but will be recognized if set. bandwidthLimit and averageBandwidthLimit are 
the first.
Change way we handle deprecated bandwidthLimit option, hopefully fix constant 100% 
load.
Remove unused method NGRouting.transferFailed().


Index: Node.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Node.java,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -w -r1.236 -r1.237
--- Node.java   31 Oct 2003 20:51:17 -0000      1.236
+++ Node.java   1 Nov 2003 15:13:36 -0000       1.237
@@ -637,6 +637,7 @@
         config.setExpert ("bandwidthLimit", true); // because deprecated
         config.argDesc   ("bandwidthLimit", "<bytes/sec>");
         config.shortDesc ("bandwidthLimit", "DEPRECATED");
+        config.setDeprecated("bandwidthLimit", true);
         config.longDesc  ("bandwidthLimit",
                           "The maximum number of bytes per second to transmit, 
totaled between",
                           "incoming and outgoing connections.  Ignored if either 
inputBandwidthLimit",
@@ -658,6 +659,7 @@
         // averageBandwidthLimit
         config.setExpert ("averageBandwidthLimit", true);
         config.argDesc   ("averageBandwidthLimit", "<bytes/sec>");
+        config.setDeprecated("averageBandwidthLimit", true);
         config.shortDesc("averageBandwidthLimit", "DEPRECATED");
         config.longDesc  ("averageBandwidthLimit",
                           "The maximum number of bytes per second to transmit 
(averaged over a week),",
@@ -2050,19 +2052,10 @@
                 Core.logger.log(Node.class, err, Logger.ERROR);
                 System.err.println(err);
                 System.out.println(err);
-        
-                if(doLowLevelInputLimiting) {
-                    ibw = new 
Bandwidth((int)(bandwidthLimit*lowLevelBWLimitMultiplier/2), 
-                                        
(int)(averageBandwidthLimit*lowLevelBWLimitMultiplier/2),
-                                        Bandwidth.RECEIVED);
-                } else ibw = null;
-                if(doLowLevelOutputLimiting) {
-                    obw = new 
Bandwidth((int)(bandwidthLimit*lowLevelBWLimitMultiplier/2), 
-                                        
(int)(averageBandwidthLimit*lowLevelBWLimitMultiplier/2),
-                                        Bandwidth.SENT);
-                } else obw = null;
+                outputBandwidthLimit = bandwidthLimit/2;
+                inputBandwidthLimit = bandwidthLimit/2;
+            }
             }
-        } else {
             if(doLowLevelInputLimiting) {
                 ibw= inputBandwidthLimit == 0 ? null : 
                     new 
Bandwidth((int)(inputBandwidthLimit*lowLevelBWLimitMultiplier),
@@ -2075,7 +2068,6 @@
                                   
(int)(averageOutputBandwidthLimit*lowLevelBWLimitMultiplier),
                                   Bandwidth.SENT);
             } else obw = null;
-        }
     
         if(params.getBoolean("limitAll")) {
             logger.log(Node.class, "Limiting all connections",

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

Reply via email to