cleanups
This commit is contained in:
@ -8,6 +8,7 @@ package net.i2p.client;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.i2cp.I2CPMessage;
|
||||
import net.i2p.data.i2cp.BandwidthLimitsMessage;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Handle I2CP BW replies from the router
|
||||
@ -18,6 +19,7 @@ class BWLimitsMessageHandler extends HandlerImpl {
|
||||
}
|
||||
|
||||
public void handleMessage(I2CPMessage message, I2PSessionImpl session) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Handle message " + message);
|
||||
BandwidthLimitsMessage msg = (BandwidthLimitsMessage) message;
|
||||
((I2PSimpleSession)session).bwReceived(msg.getLimits());
|
||||
|
@ -8,6 +8,7 @@ package net.i2p.client;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.i2cp.I2CPMessage;
|
||||
import net.i2p.data.i2cp.DestReplyMessage;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Handle I2CP dest replies from the router
|
||||
@ -18,6 +19,7 @@ class DestReplyMessageHandler extends HandlerImpl {
|
||||
}
|
||||
|
||||
public void handleMessage(I2CPMessage message, I2PSessionImpl session) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Handle message " + message);
|
||||
DestReplyMessage msg = (DestReplyMessage) message;
|
||||
((I2PSimpleSession)session).destReceived(msg.getDestination());
|
||||
|
@ -42,14 +42,13 @@ import net.i2p.util.Log;
|
||||
*/
|
||||
class I2CPMessageProducer {
|
||||
private final static Log _log = new Log(I2CPMessageProducer.class);
|
||||
private I2PAppContext _context;
|
||||
private final I2PAppContext _context;
|
||||
private int _sendBps;
|
||||
private long _sendPeriodBytes;
|
||||
private long _sendPeriodBeginTime;
|
||||
|
||||
public I2CPMessageProducer(I2PAppContext context) {
|
||||
_context = context;
|
||||
_sendBps = 0;
|
||||
context.statManager().createRateStat("client.sendBpsRaw", "How fast we pump out I2CP data messages", "ClientMessages", new long[] { 60*1000, 5*60*1000, 10*60*1000, 60*60*1000 });
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ package net.i2p.client;
|
||||
*/
|
||||
|
||||
import net.i2p.I2PException;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Thrown when there is a problem doing something on the session
|
||||
@ -18,7 +17,6 @@ import net.i2p.util.Log;
|
||||
* @author jrandom
|
||||
*/
|
||||
public class I2PSessionException extends I2PException {
|
||||
private final static Log _log = new Log(I2PSessionException.class);
|
||||
|
||||
public I2PSessionException(String msg, Throwable t) {
|
||||
super(msg, t);
|
||||
|
@ -13,6 +13,7 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.i2cp.I2CPMessage;
|
||||
import net.i2p.data.i2cp.SetDateMessage;
|
||||
import net.i2p.util.Clock;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Handle I2CP time messages from the router
|
||||
@ -25,6 +26,7 @@ class SetDateMessageHandler extends HandlerImpl {
|
||||
}
|
||||
|
||||
public void handleMessage(I2CPMessage message, I2PSessionImpl session) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Handle message " + message);
|
||||
SetDateMessage msg = (SetDateMessage) message;
|
||||
// Only do this if we are NOT in the router context;
|
||||
|
Reference in New Issue
Block a user