diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java index 17cadb94d..3058b973b 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java @@ -236,4 +236,23 @@ public class ConfigNetHelper { buf.append("\n"); return buf.toString(); } + + public int getShareBandwidth() { + String irate = _context.getProperty(PROP_INBOUND_KBPS); + String orate = _context.getProperty(PROP_OUTBOUND_KBPS); + String pctStr = _context.getProperty(PROP_SHARE_PERCENTAGE); + if ( (irate != null) && (orate != null) && (pctStr != null)) { + try { + int irateKBps = Integer.parseInt(irate); + int orateKBps = Integer.parseInt(orate); + if (irateKBps < 0 || orateKBps < 0) + return 0; + int pct = Integer.parseInt(pctStr); + return (int) (((float) pct) * Math.min(irateKBps, orateKBps) / 100); + } catch (NumberFormatException nfe) { + // ignore + } + } + return 0; + } } diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index 7bda1a598..dc18a101b 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -43,9 +43,20 @@ A negative rate means a default limit of 16KBytes per second.
Bandwidth share percentage:
- Sharing a higher percentage will improve your anonymity and help the network
+ <% int share = nethelper.getShareBandwidth(); + if (share <= 16) { + out.print("NOTE: You have configured I2P to share only " + share + "KBps. "); + out.print("I2P requires over 16KBps to enable sharing. "); + out.print("Please enable sharing by configuring greater than 16 KBps to improve your anonymity and help the network.
"); + } else { + out.print("You have configured I2P to share " + share + "KBps. "); + out.print("The higher the share bandwidth the more you improve your anonymity and help the network.
"); + } + %> +



+ External UDP address:
Require SSU introductions? />
diff --git a/history.txt b/history.txt index 78298a330..ed343041d 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,8 @@ -$Id: history.txt,v 1.570 2007-06-27 20:51:16 jrandom Exp $ +$Id: history.txt,v 1.571 2007-07-01 17:07:53 zzz Exp $ + +2007-07-04 zzz + * Display calculated share bandwidth and remove load testing + on config.jsp 2007-07-01 zzz * Replace broken option i2np.udp.alwaysPreferred with diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index e0e775cf1..76c63085f 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.505 $ $Date: 2007-06-27 20:51:18 $"; + public final static String ID = "$Revision: 1.506 $ $Date: 2007-07-01 17:07:52 $"; public final static String VERSION = "0.6.1.28"; - public final static long BUILD = 8; + public final static long BUILD = 9; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID);