2005-04-05 jrandom

* After a successfull netDb search for a leaseSet, republish it to all of
      the peers we have tried so far who did not give us the key (up to 10),
      rather than the old K closest (which may include peers who had given us
      the key)
    * Don't wait 5 minutes to publish a leaseSet (duh!), and rather than
      republish it every 5 minutes, republish it every 3.  In addition, always
      republish as soon as the leaseSet changes (duh^2).
    * Minor fix for oddball startup race (thanks travis_bickle!)
    * Minor AES update to allow in-place decryption.
This commit is contained in:
jrandom
2005-04-05 16:06:14 +00:00
committed by zzz
parent 400feb3ba7
commit bc626ece2d
13 changed files with 195 additions and 40 deletions

View File

@ -24,12 +24,18 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
private boolean _updateAvailable;
private long _lastFetch;
private static NewsFetcher _instance;
public static final NewsFetcher getInstance() { return _instance; }
//public static final synchronized NewsFetcher getInstance() { return _instance; }
public static final synchronized NewsFetcher getInstance(I2PAppContext ctx) {
if (_instance != null)
return _instance;
_instance = new NewsFetcher(ctx);
return _instance;
}
private static final String NEWS_FILE = "docs/news.xml";
private static final String TEMP_NEWS_FILE = "docs/news.xml.temp";
public NewsFetcher(I2PAppContext ctx) {
private NewsFetcher(I2PAppContext ctx) {
_context = ctx;
_log = ctx.logManager().getLog(NewsFetcher.class);
_instance = this;

View File

@ -73,7 +73,8 @@ public class RouterConsoleRunner {
t.printStackTrace();
}
I2PThread t = new I2PThread(new NewsFetcher(I2PAppContext.getGlobalContext()), "NewsFetcher");
NewsFetcher fetcher = NewsFetcher.getInstance(I2PAppContext.getGlobalContext());
I2PThread t = new I2PThread(fetcher, "NewsFetcher");
t.setDaemon(true);
t.start();
}

View File

@ -469,6 +469,6 @@ public class SummaryHelper {
}
public boolean updateAvailable() {
return NewsFetcher.getInstance().updateAvailable();
return NewsFetcher.getInstance(_context).updateAvailable();
}
}