Reduce priority of participating traffic

This commit is contained in:
zzz
2008-04-07 17:41:19 +00:00
parent a7a6c75ac5
commit d57356f807
5 changed files with 9 additions and 7 deletions

View File

@ -41,7 +41,7 @@ public class InboundGatewayReceiver implements TunnelGateway.Receiver {
out.setMessage(msg);
out.setTarget(_target);
out.setExpiration(msg.getMessageExpiration());
out.setPriority(400);
out.setPriority(200);
_context.outNetMessagePool().add(out);
return msg.getUniqueId();
}

View File

@ -16,12 +16,14 @@ import net.i2p.util.Log;
*/
public class OutboundMessageDistributor {
private RouterContext _context;
private int _priority;
private Log _log;
private static final int MAX_DISTRIBUTE_TIME = 10*1000;
public OutboundMessageDistributor(RouterContext ctx) {
public OutboundMessageDistributor(RouterContext ctx, int priority) {
_context = ctx;
_priority = priority;
_log = ctx.logManager().getLog(OutboundMessageDistributor.class);
}
@ -62,7 +64,7 @@ public class OutboundMessageDistributor {
out.setExpiration(_context.clock().now() + MAX_DISTRIBUTE_TIME);
out.setTarget(target);
out.setMessage(m);
out.setPriority(400);
out.setPriority(_priority);
if (_log.shouldLog(Log.DEBUG))
_log.debug("queueing outbound message to " + target.getIdentity().calculateHash().toBase64().substring(0,4));

View File

@ -26,7 +26,7 @@ public class OutboundTunnelEndpoint {
_config = config;
_processor = processor;
_handler = new RouterFragmentHandler(ctx, new DefragmentedHandler());
_outDistributor = new OutboundMessageDistributor(ctx);
_outDistributor = new OutboundMessageDistributor(ctx, 200);
}
public void dispatch(TunnelDataMessage msg, Hash recvFrom) {
_config.incrementProcessedMessages();

View File

@ -29,7 +29,7 @@ public class TunnelGatewayZeroHop extends TunnelGateway {
if (config.isInbound())
_inDistributor = new InboundMessageDistributor(_context, config.getDestination());
else
_outDistributor = new OutboundMessageDistributor(context);
_outDistributor = new OutboundMessageDistributor(context, 400);
}
/**

View File

@ -157,7 +157,7 @@ public class TunnelParticipant {
m.setMessage(msg);
m.setExpiration(msg.getMessageExpiration());
m.setTarget(ri);
m.setPriority(400);
m.setPriority(200);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Forward on from " + _config + ": " + msg);
_context.outNetMessagePool().add(m);