SSU2: Post-termination handler part 7

Kill handlers at shutdown
This commit is contained in:
zzz
2022-12-06 13:06:37 -05:00
parent 41e05c8135
commit 55f2d782ce
4 changed files with 15 additions and 1 deletions

View File

@@ -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

View File

@@ -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 = "";

View File

@@ -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; }

View File

@@ -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();
}
}