forked from I2P_Developers/i2p.i2p
SSU2: Post-termination handler part 7
Kill handlers at shutdown
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2022-12-06 zzz
|
||||
* SSU2: Add handler to process post-termination messages
|
||||
|
||||
2022-12-04 zzz
|
||||
* SSU2: Token improvements and fixes
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Git";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 4;
|
||||
public final static long BUILD = 5;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
||||
@@ -86,6 +86,14 @@ class PeerStateDestroyed implements SSU2Payload.PayloadCallback, SSU2Sender {
|
||||
_killTimer.schedule(MAX_LIFETIME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call at transport shutdown
|
||||
*/
|
||||
public void kill() {
|
||||
_ackTimer.cancel();
|
||||
_killTimer.cancel();
|
||||
}
|
||||
|
||||
/// begin SSU2Sender interface ///
|
||||
|
||||
public RemoteHostId getRemoteHostId() { return _remoteHostId; }
|
||||
|
||||
@@ -875,6 +875,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
_peersByConnID.clear();
|
||||
if (_recentlyClosedConnIDs != null) {
|
||||
synchronized(_addDropLock) {
|
||||
for (PeerStateDestroyed psd : _recentlyClosedConnIDs.values()) {
|
||||
psd.kill();
|
||||
}
|
||||
_recentlyClosedConnIDs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user