2005-10-31 jrandom

* Fix for some syndie reply scenarios (thanks identiguy and CofE!)
    * Removed a potentially infinitely recursive call (oops)
(forgot to commit this file before.  oops)
This commit is contained in:
jrandom
2005-11-04 03:08:00 +00:00
committed by zzz
parent ca0af146b7
commit 0ad18cd0ba

View File

@@ -41,6 +41,7 @@ import net.i2p.stat.Rate;
import net.i2p.stat.RateStat;
import net.i2p.util.FileUtil;
import net.i2p.util.I2PThread;
import net.i2p.util.SimpleTimer;
import net.i2p.util.Log;
/**
@@ -326,14 +327,20 @@ public class Router {
}
ri.sign(key);
setRouterInfo(ri);
SimpleTimer.getInstance().addEvent(new Republish(), 0);
} catch (DataFormatException dfe) {
_log.log(Log.CRIT, "Internal error - unable to sign our own address?!", dfe);
}
}
private class Republish implements SimpleTimer.TimedEvent {
public void timeReached() {
try {
_context.netDb().publish(ri);
_context.netDb().publish(getRouterInfo());
} catch (IllegalArgumentException iae) {
_log.log(Log.CRIT, "Local router info is invalid? rebuilding a new identity", iae);
rebuildNewIdentity();
}
} catch (DataFormatException dfe) {
_log.log(Log.CRIT, "Internal error - unable to sign our own address?!", dfe);
}
}