forked from I2P_Developers/i2p.i2p
Router: Clear I2CP lookup cache on exit
This commit is contained in:
@ -59,9 +59,14 @@ import net.i2p.util.VersionComparator;
|
|||||||
* Implementation of an I2P session running over TCP. This class is NOT thread safe -
|
* Implementation of an I2P session running over TCP. This class is NOT thread safe -
|
||||||
* only one thread should send messages at any given time
|
* only one thread should send messages at any given time
|
||||||
*
|
*
|
||||||
|
* Public only for clearCache().
|
||||||
|
* Except for methods definied in I2PSession and I2CPMessageEventListener,
|
||||||
|
* not maintained as a public API, not for external use.
|
||||||
|
* Use I2PClientFactory to get an I2PClient and then createSession().
|
||||||
|
*
|
||||||
* @author jrandom
|
* @author jrandom
|
||||||
*/
|
*/
|
||||||
abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessageEventListener {
|
public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessageEventListener {
|
||||||
protected final Log _log;
|
protected final Log _log;
|
||||||
/** who we are */
|
/** who we are */
|
||||||
private final Destination _myDestination;
|
private final Destination _myDestination;
|
||||||
@ -1149,6 +1154,13 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.20 */
|
||||||
|
public static void clearCache() {
|
||||||
|
synchronized (_lookupCache) {
|
||||||
|
_lookupCache.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blocking. Waits a max of 10 seconds by default.
|
* Blocking. Waits a max of 10 seconds by default.
|
||||||
* See lookupDest with maxWait parameter to change.
|
* See lookupDest with maxWait parameter to change.
|
||||||
|
@ -20,6 +20,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
|
|
||||||
import gnu.getopt.Getopt;
|
import gnu.getopt.Getopt;
|
||||||
|
|
||||||
|
import net.i2p.client.I2PSessionImpl;
|
||||||
import net.i2p.crypto.SigUtil;
|
import net.i2p.crypto.SigUtil;
|
||||||
import net.i2p.data.Base64;
|
import net.i2p.data.Base64;
|
||||||
import net.i2p.data.Certificate;
|
import net.i2p.data.Certificate;
|
||||||
@ -418,6 +419,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
PublicKey.clearCache();
|
PublicKey.clearCache();
|
||||||
SigningPublicKey.clearCache();
|
SigningPublicKey.clearCache();
|
||||||
SigUtil.clearCaches();
|
SigUtil.clearCaches();
|
||||||
|
I2PSessionImpl.clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user