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

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

* LoadTestManager: Delete, unused

    * SendGarlicMessageJob: Delete, unused
    * config.jsp: Comment out unused burst config code
parent 7f33051f
No related branches found
No related tags found
No related merge requests found
package net.i2p.router.web;
import net.i2p.data.RouterInfo;
import net.i2p.router.LoadTestManager;
import net.i2p.router.Router;
import net.i2p.router.transport.FIFOBandwidthRefiller;
import net.i2p.router.transport.TransportManager;
......@@ -307,6 +306,9 @@ public class ConfigNetHandler extends FormHandler {
_context.router().setConfigSetting(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH, _outboundRate);
updated = true;
}
/******* These aren't in the GUI for now
if ( (_inboundBurstRate != null) && (_inboundBurstRate.length() > 0) &&
!_inboundBurstRate.equals(_context.getProperty(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH, "" + FIFOBandwidthRefiller.DEFAULT_INBOUND_BURST_BANDWIDTH))) {
_context.router().setConfigSetting(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH, _inboundBurstRate);
......@@ -353,6 +355,9 @@ public class ConfigNetHandler extends FormHandler {
updated = true;
}
}
***********/
if (updated && !_ratesOnly) {
_context.bandwidthLimiter().reinitialize();
......
......@@ -3,7 +3,6 @@ package net.i2p.router.web;
import net.i2p.data.DataHelper;
import net.i2p.data.RouterAddress;
import net.i2p.router.CommSystemFacade;
import net.i2p.router.LoadTestManager;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.transport.Addresses;
......@@ -214,11 +213,9 @@ public class ConfigNetHelper extends HelperBase {
return buf.toString();
}
/** removed */
public String getEnableLoadTesting() {
if (LoadTestManager.isEnabled(_context))
return CHECKED;
else
return "";
return "";
}
public String getSharePercentageBox() {
......
This diff is collapsed.
package net.i2p.router.tunnel.pool;
import java.util.Set;
import net.i2p.data.Certificate;
import net.i2p.data.RouterInfo;
import net.i2p.data.SessionKey;
import net.i2p.data.TunnelId;
import net.i2p.data.i2np.DeliveryInstructions;
import net.i2p.data.i2np.GarlicMessage;
import net.i2p.data.i2np.I2NPMessage;
import net.i2p.router.Job;
import net.i2p.router.JobImpl;
import net.i2p.router.MessageSelector;
import net.i2p.router.OutNetMessage;
import net.i2p.router.ReplyJob;
import net.i2p.router.RouterContext;
import net.i2p.router.TunnelInfo;
import net.i2p.router.message.GarlicMessageBuilder;
import net.i2p.router.message.PayloadGarlicConfig;
import net.i2p.util.Log;
/**
* Wrap the tunnel request in a garlic to the participant, and then send it out
* a tunnel.
*
*/
class SendGarlicMessageJob extends JobImpl {
private Log _log;
private I2NPMessage _payload;
private RouterInfo _target;
private MessageSelector _replySelector;
private ReplyJob _onReply;
private Job _onTimeout;
private SessionKey _sentKey;
private Set _sentTags;
/** only elGamal the message, never use session tags */
private static final boolean FORCE_ELGAMAL = false;
public SendGarlicMessageJob(RouterContext ctx, I2NPMessage payload, RouterInfo target, MessageSelector selector, ReplyJob onReply, Job onTimeout, SessionKey sentKey, Set sentTags) {
super(ctx);
_log = ctx.logManager().getLog(SendGarlicMessageJob.class);
_payload = payload;
_target = target;
_replySelector = selector;
_onReply = onReply;
_onTimeout = onTimeout;
_sentKey = sentKey;
_sentTags = sentTags;
}
public String getName() { return "build and send request garlic"; }
public void runJob() {
DeliveryInstructions instructions = new DeliveryInstructions();
instructions.setDeliveryMode(DeliveryInstructions.DELIVERY_MODE_LOCAL);
PayloadGarlicConfig payload = new PayloadGarlicConfig();
payload.setCertificate(new Certificate(Certificate.CERTIFICATE_TYPE_NULL, null));
payload.setId(getContext().random().nextLong(I2NPMessage.MAX_ID_VALUE));
payload.setPayload(_payload);
payload.setRecipient(_target);
payload.setDeliveryInstructions(instructions);
payload.setRequestAck(false);
payload.setExpiration(_payload.getMessageExpiration());
int timeout = (int)(payload.getExpiration() - getContext().clock().now());
GarlicMessage msg = null;
if (FORCE_ELGAMAL)
msg = GarlicMessageBuilder.buildMessage(getContext(), payload, _sentKey, _sentTags, 0, true);
else
msg = GarlicMessageBuilder.buildMessage(getContext(), payload, _sentKey, _sentTags);
// so we will look for the reply
OutNetMessage dummyMessage = getContext().messageRegistry().registerPending(_replySelector, _onReply, _onTimeout, timeout);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Scheduling timeout job (" + _onTimeout + ") to be run in " + timeout + "ms");
// now find an outbound tunnel and send 'er off
TunnelInfo out = getContext().tunnelManager().selectOutboundTunnel();
if (out == null) {
if (_onTimeout != null)
getContext().jobQueue().addJob(_onTimeout);
getContext().messageRegistry().unregisterPending(dummyMessage);
return;
}
TunnelId outId = out.getSendTunnelId(0);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Dispatching the garlic request out " + outId + " targetting " + _target.getIdentity().calculateHash().toBase64().substring(0,4));
getContext().tunnelDispatcher().dispatchOutbound(msg, outId, _target.getIdentity().calculateHash());
}
}
......@@ -20,7 +20,6 @@ import net.i2p.data.RouterInfo;
import net.i2p.data.TunnelId;
import net.i2p.router.ClientTunnelSettings;
import net.i2p.router.JobImpl;
import net.i2p.router.LoadTestManager;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.TunnelInfo;
......@@ -43,7 +42,6 @@ public class TunnelPoolManager implements TunnelManagerFacade {
private final Map _clientOutboundPools;
private TunnelPool _inboundExploratory;
private TunnelPool _outboundExploratory;
private LoadTestManager _loadTestManager;
private BuildExecutor _executor;
private boolean _isShutdown;
......@@ -59,8 +57,6 @@ public class TunnelPoolManager implements TunnelManagerFacade {
_clientInboundPools = new HashMap(4);
_clientOutboundPools = new HashMap(4);
if (! LoadTestManager.FORCE_DISABLE)
_loadTestManager = new LoadTestManager(_context);
_isShutdown = false;
_executor = new BuildExecutor(ctx, this);
......@@ -311,8 +307,6 @@ public class TunnelPoolManager implements TunnelManagerFacade {
void buildComplete(PooledTunnelCreatorConfig cfg) {
buildComplete();
if (_loadTestManager != null)
_loadTestManager.addTunnelTestCandidate(cfg);
if (cfg.getLength() > 1) {
TunnelPool pool = cfg.getTunnelPool();
if (pool == null) {
......@@ -341,8 +335,6 @@ public class TunnelPoolManager implements TunnelManagerFacade {
}
void buildComplete() {}
private static final String PROP_LOAD_TEST = "router.loadTest";
public void startup() {
_isShutdown = false;
if (!_executor.isRunning()) {
......
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