Author: toad
Date: 2006-07-08 20:36:22 +0000 (Sat, 08 Jul 2006)
New Revision: 9516

Modified:
   trunk/freenet/src/freenet/node/Node.java
   trunk/freenet/src/freenet/node/Version.java
Log:
869: Fix startup problem when inputBandwidthLimit not set.

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2006-07-08 20:29:27 UTC (rev 
9515)
+++ trunk/freenet/src/freenet/node/Node.java    2006-07-08 20:36:22 UTC (rev 
9516)
@@ -1257,15 +1257,21 @@
                                                if(ibwLimit == -1) {
                                                        inputLimitDefault = 
true;
                                                        ibwLimit = (int) 
((1000L * 1000L * 1000L) / outputThrottle.getNanosPerTick()) * 4;
+                                               } else {
+                                                       ibwLimit = ibwLimit * 4 
/ 5; // fudge factor; take into account non-request activity
                                                }
                                                if(ibwLimit <= 0) throw new 
InvalidConfigValueException("Bandwidth limit must be positive or -1");
-                                               ibwLimit = ibwLimit * 4 / 5; // 
fudge factor; take into account non-request activity
                                                
requestInputThrottle.changeNanosAndBucketSize((1000L*1000L*1000L) /  ibwLimit, 
Math.max(ibwLimit*60, 32768*20));
                                        }
                });

                int ibwLimit = nodeConfig.getInt("inputBandwidthLimit");
-               ibwLimit = ibwLimit * 4 / 5;
+               if(ibwLimit == -1) {
+                       inputLimitDefault = true;
+                       ibwLimit = (int) ((1000L * 1000L * 1000L) / 
outputThrottle.getNanosPerTick()) * 4;
+               } else {
+                       ibwLimit = ibwLimit * 4 / 5;
+               }
                requestInputThrottle = 
                        new TokenBucket(Math.max(ibwLimit*60, 32768*20), 
(1000L*1000L*1000L) / ibwLimit, 0);


Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-07-08 20:29:27 UTC (rev 
9515)
+++ trunk/freenet/src/freenet/node/Version.java 2006-07-08 20:36:22 UTC (rev 
9516)
@@ -18,7 +18,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       private static final int buildNumber = 868;
+       private static final int buildNumber = 869;

        /** Oldest build of Fred we will talk to */
        private static final int oldLastGoodBuild = 844;


Reply via email to