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

Skip to content
Snippets Groups Projects
Commit a05e8a44 authored by jrandom's avatar jrandom Committed by zzz
Browse files

update the default tunnel settings dynamically (adjusting the pool size accordingly)

parent 21126f76
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.Set;
import net.i2p.data.TunnelId;
import net.i2p.router.ClientTunnelSettings;
import net.i2p.router.JobImpl;
import net.i2p.router.RouterContext;
import net.i2p.router.TunnelInfo;
......@@ -44,6 +45,18 @@ class TunnelPoolManagerJob extends JobImpl {
boolean built = false;
ClientTunnelSettings settings = new ClientTunnelSettings();
settings.readFromProperties(getContext().router().getConfigMap());
_pool.setPoolSettings(settings);
try {
String str = getContext().router().getConfigSetting(TunnelPool.TARGET_CLIENTS_PARAM);
int clients = Integer.parseInt(str);
_pool.setTargetClients(clients);
} catch (NumberFormatException nfe) {
// ignore
}
int targetClients = _pool.getTargetClients();
int targetInboundTunnels = targetClients*_pool.getPoolSettings().getNumInboundTunnels() + 1;
int targetOutboundTunnels = targetClients*_pool.getPoolSettings().getNumOutboundTunnels() + 1;
......
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