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

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

make inbound and exploratory settings final

parent 583463ab
No related branches found
No related tags found
No related merge requests found
...@@ -20,12 +20,8 @@ public class ClientTunnelSettings { ...@@ -20,12 +20,8 @@ public class ClientTunnelSettings {
private TunnelPoolSettings _outboundSettings; private TunnelPoolSettings _outboundSettings;
public ClientTunnelSettings() { public ClientTunnelSettings() {
_inboundSettings = new TunnelPoolSettings(); _inboundSettings = new TunnelPoolSettings(false, true);
_inboundSettings.setIsInbound(true); _outboundSettings = new TunnelPoolSettings(false, false);
_inboundSettings.setIsExploratory(false);
_outboundSettings = new TunnelPoolSettings();
_outboundSettings.setIsInbound(false);
_outboundSettings.setIsExploratory(false);
} }
public TunnelPoolSettings getInboundSettings() { return _inboundSettings; } public TunnelPoolSettings getInboundSettings() { return _inboundSettings; }
......
...@@ -21,8 +21,8 @@ public class TunnelPoolSettings { ...@@ -21,8 +21,8 @@ public class TunnelPoolSettings {
private int _length; private int _length;
private int _lengthVariance; private int _lengthVariance;
private int _lengthOverride; private int _lengthOverride;
private boolean _isInbound; private final boolean _isInbound;
private boolean _isExploratory; private final boolean _isExploratory;
private boolean _allowZeroHop; private boolean _allowZeroHop;
private int _IPRestriction; private int _IPRestriction;
private final Properties _unknownOptions; private final Properties _unknownOptions;
...@@ -54,7 +54,9 @@ public class TunnelPoolSettings { ...@@ -54,7 +54,9 @@ public class TunnelPoolSettings {
public static final boolean DEFAULT_ALLOW_ZERO_HOP = true; public static final boolean DEFAULT_ALLOW_ZERO_HOP = true;
public static final int DEFAULT_IP_RESTRICTION = 2; // class B (/16) public static final int DEFAULT_IP_RESTRICTION = 2; // class B (/16)
public TunnelPoolSettings() { public TunnelPoolSettings(boolean isExploratory, boolean isInbound) {
_isExploratory = isExploratory;
_isInbound = isInbound;
_quantity = DEFAULT_QUANTITY; _quantity = DEFAULT_QUANTITY;
_backupQuantity = DEFAULT_BACKUP_QUANTITY; _backupQuantity = DEFAULT_BACKUP_QUANTITY;
// _rebuildPeriod = DEFAULT_REBUILD_PERIOD; // _rebuildPeriod = DEFAULT_REBUILD_PERIOD;
...@@ -130,11 +132,9 @@ public class TunnelPoolSettings { ...@@ -130,11 +132,9 @@ public class TunnelPoolSettings {
/** is this an inbound tunnel? */ /** is this an inbound tunnel? */
public boolean isInbound() { return _isInbound; } public boolean isInbound() { return _isInbound; }
public void setIsInbound(boolean isInbound) { _isInbound = isInbound; }
/** is this an exploratory tunnel (or a client tunnel) */ /** is this an exploratory tunnel (or a client tunnel) */
public boolean isExploratory() { return _isExploratory; } public boolean isExploratory() { return _isExploratory; }
public void setIsExploratory(boolean isExploratory) { _isExploratory = isExploratory; }
// Duration is hardcoded // Duration is hardcoded
//public int getDuration() { return _duration; } //public int getDuration() { return _duration; }
......
...@@ -64,13 +64,9 @@ public class TunnelPoolManager implements TunnelManagerFacade { ...@@ -64,13 +64,9 @@ public class TunnelPoolManager implements TunnelManagerFacade {
_clientPeerSelector = new ClientPeerSelector(ctx); _clientPeerSelector = new ClientPeerSelector(ctx);
ExploratoryPeerSelector selector = new ExploratoryPeerSelector(_context); ExploratoryPeerSelector selector = new ExploratoryPeerSelector(_context);
TunnelPoolSettings inboundSettings = new TunnelPoolSettings(); TunnelPoolSettings inboundSettings = new TunnelPoolSettings(true, true);
inboundSettings.setIsExploratory(true);
inboundSettings.setIsInbound(true);
_inboundExploratory = new TunnelPool(_context, this, inboundSettings, selector); _inboundExploratory = new TunnelPool(_context, this, inboundSettings, selector);
TunnelPoolSettings outboundSettings = new TunnelPoolSettings(); TunnelPoolSettings outboundSettings = new TunnelPoolSettings(true, false);
outboundSettings.setIsExploratory(true);
outboundSettings.setIsInbound(false);
_outboundExploratory = new TunnelPool(_context, this, outboundSettings, selector); _outboundExploratory = new TunnelPool(_context, this, outboundSettings, selector);
// threads will be started in startup() // threads will be started in startup()
......
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