I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 60bd9803 authored by zzz's avatar zzz
Browse files

fix burst seconds display

parent c3360cc3
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,7 @@ public class ConfigNetHelper {
public String getInboundBurstFactorBox() {
int numSeconds = 1;
int rateKBps = _context.bandwidthLimiter().getInboundBurstKBytesPerSecond();
int burstKB = _context.bandwidthLimiter().getInboundBurstBytes() * 1024;
int burstKB = _context.bandwidthLimiter().getInboundBurstBytes() / 1024;
if ( (rateKBps > 0) && (burstKB > 0) )
numSeconds = burstKB / rateKBps;
return getBurstFactor(numSeconds, "inboundburstfactor");
......@@ -165,7 +165,7 @@ public class ConfigNetHelper {
public String getOutboundBurstFactorBox() {
int numSeconds = 1;
int rateKBps = _context.bandwidthLimiter().getOutboundBurstKBytesPerSecond();
int burstKB = _context.bandwidthLimiter().getOutboundBurstBytes() * 1024;
int burstKB = _context.bandwidthLimiter().getOutboundBurstBytes() / 1024;
if ( (rateKBps > 0) && (burstKB > 0) )
numSeconds = burstKB / rateKBps;
return getBurstFactor(numSeconds, "outboundburstfactor");
......@@ -175,16 +175,21 @@ public class ConfigNetHelper {
StringBuffer buf = new StringBuffer(256);
buf.append("<select name=\"").append(name).append("\">\n");
boolean found = false;
for (int i = 10; i <= 60; i += 10) {
buf.append("<option value=\"").append(i).append("\" ");
if (i == numSeconds) {
for (int i = 10; i <= 70; i += 10) {
int val = i;
if (i == 70) {
if (found)
break;
else
val = numSeconds;
}
buf.append("<option value=\"").append(val).append("\" ");
if (val == numSeconds) {
buf.append("selected ");
found = true;
} else if ( (i == 60) && (!found) ) {
buf.append("selected ");
}
buf.append(">");
buf.append(i).append(" seconds</option>\n");
buf.append(val).append(" seconds</option>\n");
}
buf.append("</select>\n");
return buf.toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment