forked from I2P_Developers/i2p.i2p
* removed some failsafe code that had been preventing any messages from being sent down alternate tunnels in a leaseSet [oops]
this may have unintended consequences, as we need to deal with messages received from skewed clocks, but I believe the two pathways used here are safe (we leave the larger timeout thresholds intact for dealing with remotely generated message times)
This commit is contained in:
@@ -50,8 +50,10 @@ public class SendMessageDirectJob extends JobImpl {
|
|||||||
_message = message;
|
_message = message;
|
||||||
_targetHash = toPeer;
|
_targetHash = toPeer;
|
||||||
_router = null;
|
_router = null;
|
||||||
if (timeoutMs <= 30*1000) {
|
if (timeoutMs < 5*1000) {
|
||||||
_expiration = ctx.clock().now() + 30*1000;
|
if (_log.shouldLog(Log.WARN))
|
||||||
|
_log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy bastard"));
|
||||||
|
_expiration = ctx.clock().now() + 5*1000;
|
||||||
} else {
|
} else {
|
||||||
_expiration = timeoutMs + ctx.clock().now();
|
_expiration = timeoutMs + ctx.clock().now();
|
||||||
}
|
}
|
||||||
@@ -73,7 +75,7 @@ public class SendMessageDirectJob extends JobImpl {
|
|||||||
public void runJob() {
|
public void runJob() {
|
||||||
long now = getContext().clock().now();
|
long now = getContext().clock().now();
|
||||||
|
|
||||||
if (_expiration < now - Router.CLOCK_FUDGE_FACTOR) {
|
if (_expiration < now) {
|
||||||
if (_log.shouldLog(Log.ERROR))
|
if (_log.shouldLog(Log.ERROR))
|
||||||
_log.error("Timed out sending message " + _message + " directly (expiration = "
|
_log.error("Timed out sending message " + _message + " directly (expiration = "
|
||||||
+ new Date(_expiration) + ") to " + _targetHash.toBase64(), getAddedBy());
|
+ new Date(_expiration) + ") to " + _targetHash.toBase64(), getAddedBy());
|
||||||
@@ -82,16 +84,6 @@ public class SendMessageDirectJob extends JobImpl {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_expiration - 30*1000 < now) {
|
|
||||||
if (_log.shouldLog(Log.INFO))
|
|
||||||
_log.info("Soon to expire sendDirect of " + _message.getClass().getName()
|
|
||||||
+ " [expiring in " + (_expiration-now) + "]", getAddedBy());
|
|
||||||
|
|
||||||
// if its made it this far, we want to honor it, so make sure we give it
|
|
||||||
// enough time to be sent out
|
|
||||||
_expiration += 30*1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_router != null) {
|
if (_router != null) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Router specified, sending");
|
_log.debug("Router specified, sending");
|
||||||
|
@@ -85,8 +85,10 @@ public class SendTunnelMessageJob extends JobImpl {
|
|||||||
new Exception("SendTunnel from"));
|
new Exception("SendTunnel from"));
|
||||||
}
|
}
|
||||||
//_log.info("Send tunnel message " + msg.getClass().getName() + " to " + _destRouter + " over " + _tunnelId + " targetting tunnel " + _targetTunnelId, new Exception("SendTunnel from"));
|
//_log.info("Send tunnel message " + msg.getClass().getName() + " to " + _destRouter + " over " + _tunnelId + " targetting tunnel " + _targetTunnelId, new Exception("SendTunnel from"));
|
||||||
if (timeoutMs < 30*1000) {
|
if (timeoutMs < 5*1000) {
|
||||||
_expiration = getContext().clock().now() + 30*1000;
|
if (_log.shouldLog(Log.WARN))
|
||||||
|
_log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy bastard"));
|
||||||
|
_expiration = getContext().clock().now() + 5*1000;
|
||||||
} else {
|
} else {
|
||||||
_expiration = getContext().clock().now() + timeoutMs;
|
_expiration = getContext().clock().now() + timeoutMs;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user