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.
");
+ }
+ %>
+