* I2CP: Implement optional reduce tunnels on idle - not hooked
in to i2ptunnel GUI yet - still needs tweaks
This commit is contained in:
@ -49,7 +49,9 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
|
||||
private static final int WARN_LENGTH = 4;
|
||||
private static final int MAX_LENGTH = 4;
|
||||
private static final int MAX_QUANTITY = 3;
|
||||
private static final int WARN_QUANTITY = 5;
|
||||
private static final int MAX_QUANTITY = 6;
|
||||
private static final int MAX_BACKUP_QUANTITY = 3;
|
||||
private static final int MAX_VARIANCE = 2;
|
||||
private static final int MIN_NEG_VARIANCE = -1;
|
||||
private void renderForm(StringBuffer buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out) {
|
||||
@ -64,6 +66,9 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
if (in.getLength() + Math.abs(in.getLengthVariance()) >= WARN_LENGTH ||
|
||||
out.getLength() + Math.abs(out.getLengthVariance()) >= WARN_LENGTH)
|
||||
buf.append("<tr><td colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include very long tunnels</font></td></tr>");
|
||||
if (in.getQuantity() + in.getBackupQuantity() >= WARN_QUANTITY ||
|
||||
out.getQuantity() + out.getBackupQuantity() >= WARN_QUANTITY)
|
||||
buf.append("<tr><td colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include high tunnel quantities</font></td></tr>");
|
||||
|
||||
|
||||
buf.append("<tr><td></td><td><b>Inbound</b></td><td><b>Outbound</b></td></tr>\n");
|
||||
@ -130,15 +135,15 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
buf.append("<tr><td>Backup quantity</td>\n");
|
||||
buf.append("<td><select name=\"").append(index).append(".backupInbound\">\n");
|
||||
now = in.getBackupQuantity();
|
||||
renderOptions(buf, 0, MAX_QUANTITY, now, "", "tunnel");
|
||||
if (now > MAX_QUANTITY)
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", "tunnel");
|
||||
if (now > MAX_BACKUP_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
buf.append("<td><select name=\"").append(index).append(".backupOutbound\">\n");
|
||||
now = out.getBackupQuantity();
|
||||
renderOptions(buf, 0, MAX_QUANTITY, now, "", "tunnel");
|
||||
if (now > MAX_QUANTITY)
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", "tunnel");
|
||||
if (now > MAX_BACKUP_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
buf.append("</select></td>\n");
|
||||
buf.append("</tr>\n");
|
||||
|
Reference in New Issue
Block a user