* Raise inbound default bandwidth to 32KBps

* Fix config.jsp that showed 0KBps share bandwidth by default
This commit is contained in:
zzz
2008-02-21 14:05:33 +00:00
parent 49c02f13b2
commit 100163e03b
5 changed files with 18 additions and 13 deletions

View File

@ -164,7 +164,7 @@ public class ConfigNetHelper {
if (rate != null) if (rate != null)
return rate; return rate;
else else
return "16"; return "32";
} }
public String getOutboundRate() { public String getOutboundRate() {
String rate = _context.getProperty(PROP_OUTBOUND_KBPS); String rate = _context.getProperty(PROP_OUTBOUND_KBPS);
@ -178,7 +178,7 @@ public class ConfigNetHelper {
if (rate != null) if (rate != null)
return rate; return rate;
else else
return "32"; return "48";
} }
public String getOutboundBurstRate() { public String getOutboundBurstRate() {
String rate = _context.getProperty(PROP_OUTBOUND_BURST_KBPS); String rate = _context.getProperty(PROP_OUTBOUND_BURST_KBPS);
@ -276,21 +276,21 @@ public class ConfigNetHelper {
} }
public int getShareBandwidth() { public int getShareBandwidth() {
String irate = _context.getProperty(PROP_INBOUND_KBPS); String irate = _context.getProperty(PROP_INBOUND_KBPS, "32");
String orate = _context.getProperty(PROP_OUTBOUND_KBPS); String orate = _context.getProperty(PROP_OUTBOUND_KBPS, "16");
String pctStr = _context.getProperty(PROP_SHARE_PERCENTAGE); String pctStr = _context.getProperty(PROP_SHARE_PERCENTAGE, "" + DEFAULT_SHARE_PERCENTAGE);
if ( (irate != null) && (orate != null) && (pctStr != null)) { if ( (irate != null) && (orate != null) && (pctStr != null)) {
try { try {
int irateKBps = Integer.parseInt(irate); int irateKBps = Integer.parseInt(irate);
int orateKBps = Integer.parseInt(orate); int orateKBps = Integer.parseInt(orate);
if (irateKBps < 0 || orateKBps < 0) if (irateKBps < 0 || orateKBps < 0)
return 0; return 12;
int pct = Integer.parseInt(pctStr); int pct = Integer.parseInt(pctStr);
return (int) (((float) pct) * Math.min(irateKBps, orateKBps) / 100); return (int) (((float) pct) * Math.min(irateKBps, orateKBps) / 100);
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
// ignore // ignore
} }
} }
return 0; return 12;
} }
} }

View File

@ -40,7 +40,8 @@
<input name="outboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundBurstRate" />" /> KBps for <input name="outboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundBurstRate" />" /> KBps for
<jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br /> <jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br />
<i>KBps = kilobytes per second = 1024 bytes per second.<br /> <i>KBps = kilobytes per second = 1024 bytes per second.<br />
A negative rate means a default limit of 16KBytes per second.</i><br /> A negative inbound rate means a default limit of 32KBytes per second.
A negative outbound rate means a default limit of 16KBytes per second.</i><br />
Bandwidth share percentage: Bandwidth share percentage:
<jsp:getProperty name="nethelper" property="sharePercentageBox" /><br /> <jsp:getProperty name="nethelper" property="sharePercentageBox" /><br />
<% int share = nethelper.getShareBandwidth(); <% int share = nethelper.getShareBandwidth();

View File

@ -1,3 +1,7 @@
2008-02-21 zzz
* Raise inbound default bandwidth to 32KBps
* Fix config.jsp that showed 0KBps share bandwidth by default
2008-02-19 zzz 2008-02-19 zzz
* Addressbook: Disallow '--' in host names except in IDN, * Addressbook: Disallow '--' in host names except in IDN,
add some reserved host names add some reserved host names

View File

@ -17,7 +17,7 @@ import net.i2p.CoreVersion;
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $"; public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
public final static String VERSION = "0.6.1.31"; public final static String VERSION = "0.6.1.31";
public final static long BUILD = 5; public final static long BUILD = 6;
public static void main(String args[]) { public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID); System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -31,11 +31,11 @@ class FIFOBandwidthRefiller implements Runnable {
public static final String PROP_OUTBOUND_BANDWIDTH_PEAK = "i2np.bandwidth.outboundBurstKBytes"; public static final String PROP_OUTBOUND_BANDWIDTH_PEAK = "i2np.bandwidth.outboundBurstKBytes";
//public static final String PROP_REPLENISH_FREQUENCY = "i2np.bandwidth.replenishFrequencyMs"; //public static final String PROP_REPLENISH_FREQUENCY = "i2np.bandwidth.replenishFrequencyMs";
// no longer allow unlimited bandwidth - the user must specify a value, and if they do not, it is 16KBps // no longer allow unlimited bandwidth - the user must specify a value, and if they do not, it is 32/16KBps
public static final int DEFAULT_INBOUND_BANDWIDTH = 16; public static final int DEFAULT_INBOUND_BANDWIDTH = 32;
public static final int DEFAULT_OUTBOUND_BANDWIDTH = 16; public static final int DEFAULT_OUTBOUND_BANDWIDTH = 16;
public static final int DEFAULT_INBOUND_BURST_BANDWIDTH = 16; public static final int DEFAULT_INBOUND_BURST_BANDWIDTH = 48;
public static final int DEFAULT_OUTBOUND_BURST_BANDWIDTH = 16; public static final int DEFAULT_OUTBOUND_BURST_BANDWIDTH = 32;
public static final int DEFAULT_BURST_SECONDS = 60; public static final int DEFAULT_BURST_SECONDS = 60;