forked from I2P_Developers/i2p.i2p
misc. log tweaks
This commit is contained in:
@@ -146,14 +146,15 @@ public class InNetMessagePool implements Service {
|
||||
//if (messageBody instanceof TunnelCreateMessage)
|
||||
// level = Log.INFO;
|
||||
if (_log.shouldLog(level))
|
||||
_log.log(level, "Duplicate message received [" + messageBody.getUniqueId()
|
||||
+ " expiring on " + exp + "]: " + messageBody.getClass().getName() + ": " + invalidReason
|
||||
_log.log(level, "Dropping message [" + messageBody.getUniqueId()
|
||||
+ " expiring on " + exp + "]: " + messageBody.getClass().getSimpleName() + ": " + invalidReason
|
||||
+ ": " + messageBody);
|
||||
_context.statManager().addRateData("inNetPool.dropped", 1, 0);
|
||||
// FIXME not necessarily a duplicate, could be expired too long ago / too far in future
|
||||
_context.statManager().addRateData("inNetPool.duplicate", 1, 0);
|
||||
_context.messageHistory().droppedOtherMessage(messageBody, (fromRouter != null ? fromRouter.calculateHash() : fromRouterHash));
|
||||
_context.messageHistory().messageProcessingError(messageBody.getUniqueId(),
|
||||
messageBody.getClass().getName(),
|
||||
messageBody.getClass().getSimpleName(),
|
||||
"Duplicate/expired");
|
||||
return -1;
|
||||
} else {
|
||||
|
@@ -18,10 +18,10 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 21;
|
||||
public final static long BUILD = 22;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
public final static String EXTRA = "-rc";
|
||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + FULL_VERSION);
|
||||
|
@@ -112,7 +112,7 @@ public class GarlicMessageReceiver {
|
||||
_log.warn("Clove is NOT valid: id=" + clove.getCloveId()
|
||||
+ " expiration " + howLongAgo + " ago: " + invalidReason + ": " + clove);
|
||||
_context.messageHistory().messageProcessingError(clove.getCloveId(),
|
||||
clove.getData().getClass().getName(),
|
||||
clove.getData().getClass().getSimpleName(),
|
||||
"Clove is not valid (expiration " + howLongAgo + " ago)");
|
||||
}
|
||||
return (invalidReason == null);
|
||||
|
@@ -12,7 +12,7 @@ import net.i2p.util.Log;
|
||||
* want. The hop processor works the same on all peers -
|
||||
* inbound and outbound participants, outbound endpoints,
|
||||
* and inbound gateways (with a small modification per
|
||||
* InbuondGatewayProcessor).
|
||||
* InboundGatewayProcessor).
|
||||
*
|
||||
*/
|
||||
class HopProcessor {
|
||||
@@ -77,7 +77,7 @@ class HopProcessor {
|
||||
boolean okIV = _validator.receiveIV(orig, offset, orig, offset + IV_LENGTH);
|
||||
if (!okIV) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Invalid IV received on tunnel " + _config.getReceiveTunnel());
|
||||
_log.warn("Invalid IV, dropping at hop " + _config);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,4 +111,12 @@ class HopProcessor {
|
||||
private final void updateIV(byte orig[], int offset) {
|
||||
_context.aes().encryptBlock(orig, offset, _config.getIVKey(), orig, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.8.12
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + " for " + _config;
|
||||
}
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ class InboundEndpointProcessor {
|
||||
boolean ok = _validator.receiveIV(iv, 0, orig, offset + HopProcessor.IV_LENGTH);
|
||||
if (!ok) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Invalid IV received");
|
||||
_log.warn("Invalid IV, dropping at IBEP " + _config);
|
||||
_cache.release(ba);
|
||||
return false;
|
||||
}
|
||||
|
@@ -80,8 +80,8 @@ public class TunnelPool {
|
||||
synchronized (_inProgress) {
|
||||
_inProgress.clear();
|
||||
}
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn(toString() + ": Startup() called, was already alive? " + _alive, new Exception());
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(toString() + ": Startup() called, was already alive? " + _alive, new Exception());
|
||||
_alive = true;
|
||||
_started = System.currentTimeMillis();
|
||||
_lastRateUpdate = _started;
|
||||
|
Reference in New Issue
Block a user