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:
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -469,6 +469,6 @@ public class SummaryHelper {
|
||||
}
|
||||
|
||||
public boolean updateAvailable() {
|
||||
return NewsFetcher.getInstance().updateAvailable();
|
||||
return NewsFetcher.getInstance(_context).updateAvailable();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user