2005-04-12 jrandom

* Make sure we don't get cached updates (thanks smeghead!)
    * Clear out the callback for the TestJob after it passes (only affects the
      job timing accounting)
This commit is contained in:
jrandom
2005-04-12 15:22:11 +00:00
committed by zzz
parent e6b343070a
commit 5b56d22da9
5 changed files with 32 additions and 6 deletions

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.182 $ $Date: 2005/04/06 10:43:25 $";
public final static String ID = "$Revision: 1.183 $ $Date: 2005/04/06 11:38:38 $";
public final static String VERSION = "0.5.0.6";
public final static long BUILD = 0;
public final static long BUILD = 1;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -12,6 +12,7 @@ import net.i2p.data.i2np.GarlicMessage;
import net.i2p.data.i2np.I2NPMessage;
import net.i2p.router.JobImpl;
import net.i2p.router.MessageSelector;
import net.i2p.router.OutNetMessage;
import net.i2p.router.ReplyJob;
import net.i2p.router.RouterContext;
import net.i2p.router.TunnelInfo;
@ -78,7 +79,8 @@ class TestJob extends JobImpl {
ReplySelector sel = new ReplySelector(getContext(), m.getMessageId(), testExpiration + 2*testPeriod);
OnTestReply onReply = new OnTestReply(getContext());
OnTestTimeout onTimeout = new OnTestTimeout(getContext());
getContext().messageRegistry().registerPending(sel, onReply, onTimeout, 3*testPeriod);
OutNetMessage msg = getContext().messageRegistry().registerPending(sel, onReply, onTimeout, 3*testPeriod);
onReply.setSentMessage(msg);
sendTest(m);
}
}
@ -201,9 +203,13 @@ class TestJob extends JobImpl {
*/
private class OnTestReply extends JobImpl implements ReplyJob {
private long _successTime;
private OutNetMessage _sentMessage;
public OnTestReply(RouterContext ctx) { super(ctx); }
public String getName() { return "Tunnel test success"; }
public void setSentMessage(OutNetMessage m) { _sentMessage = m; }
public void runJob() {
if (_sentMessage != null)
getContext().messageRegistry().unregisterPending(_sentMessage);
if (_successTime < getTestPeriod())
testSuccessful((int)_successTime);
else
@ -234,6 +240,7 @@ class TestJob extends JobImpl {
}
public String getName() { return "Tunnel test timeout"; }
public void runJob() {
_log.error("Timeout: found? " + _found, getAddedBy());
if (!_found)
testFailed(getContext().clock().now() - _started);
}