From 1305969247572e3131d04f5ca1727afb6b36f96b Mon Sep 17 00:00:00 2001 From: jrandom <jrandom> Date: Sun, 1 Aug 2004 20:39:17 +0000 Subject: [PATCH] requeues aren't absurd in a live net where connectivity sometimes fails (duh) --- .../i2p/router/transport/TransportImpl.java | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/TransportImpl.java b/router/java/src/net/i2p/router/transport/TransportImpl.java index 24f3682193..f0debebb74 100644 --- a/router/java/src/net/i2p/router/transport/TransportImpl.java +++ b/router/java/src/net/i2p/router/transport/TransportImpl.java @@ -117,31 +117,23 @@ public abstract class TransportImpl implements Transport { _context.statManager().addRateData("transport.expiredOnQueueLifetime", lifetime, lifetime); if (allowRequeue) { - if (true) { - if (_log.shouldLog(Log.ERROR)) - _log.error("wtf, requeueing message " + msg.getMessageId() + " of type " + msg.getMessageType(), - new Exception("requeued by")); - log = true; - msg.discardData(); + if ( (msg.getExpiration() <= 0) || (msg.getExpiration() > _context.clock().now()) ) { + // this may not be the last transport available - keep going + _context.outNetMessagePool().add(msg); + // don't discard the data yet! } else { - if ( (msg.getExpiration() <= 0) || (msg.getExpiration() > _context.clock().now()) ) { - // this may not be the last transport available - keep going - _context.outNetMessagePool().add(msg); - // don't discard the data yet! - } else { - if (_log.shouldLog(Log.INFO)) - _log.info("No more time left (" + new Date(msg.getExpiration()) - + ", expiring without sending successfully the " - + msg.getMessageType()); - if (msg.getOnFailedSendJob() != null) - _context.jobQueue().addJob(msg.getOnFailedSendJob()); - MessageSelector selector = msg.getReplySelector(); - if (selector != null) { - _context.messageRegistry().unregisterPending(msg); - } - log = true; - msg.discardData(); + if (_log.shouldLog(Log.INFO)) + _log.info("No more time left (" + new Date(msg.getExpiration()) + + ", expiring without sending successfully the " + + msg.getMessageType()); + if (msg.getOnFailedSendJob() != null) + _context.jobQueue().addJob(msg.getOnFailedSendJob()); + MessageSelector selector = msg.getReplySelector(); + if (selector != null) { + _context.messageRegistry().unregisterPending(msg); } + log = true; + msg.discardData(); } } else { if (_log.shouldLog(Log.INFO)) -- GitLab