2007-07-04 zzz

* Display calculated share bandwidth and remove load testing
      on config.jsp
This commit is contained in:
zzz
2007-07-04 22:58:48 +00:00
committed by zzz
parent 2dc5fbda02
commit 409b71def5
4 changed files with 39 additions and 4 deletions

View File

@ -236,4 +236,23 @@ public class ConfigNetHelper {
buf.append("</select>\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;
}
}

View File

@ -43,9 +43,20 @@
A negative rate means a default limit of 16KBytes per second.</i><br />
Bandwidth share percentage:
<jsp:getProperty name="nethelper" property="sharePercentageBox" /><br />
Sharing a higher percentage will improve your anonymity and help the network<br />
<% int share = nethelper.getShareBandwidth();
if (share <= 16) {
out.print("<b>NOTE</b>: 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.<br />");
} 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.<br />");
}
%>
<p>
<input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /><br />
<hr />
<!--
<b>Enable load testing: </b>
<input type="checkbox" name="enableloadtesting" value="true" <jsp:getProperty name="nethelper" property="enableLoadTesting" /> />
<p>If enabled, your router will periodically anonymously probe some of your peers
@ -54,6 +65,7 @@
load testing is fed into the profiles as well as the
<a href="oldstats.jsp#test.rtt">test.rtt</a> and related stats.</p>
<hr />
-->
<b>External UDP address:</b> <i><jsp:getProperty name="nethelper" property="udpAddress" /></i><br />
<b>Require SSU introductions? </b>
<input type="checkbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> /><br />

View File

@ -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

View File

@ -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);