SSU2: Send termination in response to termination

This commit is contained in:
zzz
2022-07-26 09:51:41 -04:00
parent 17695915fa
commit e4a8a6492d

View File

@ -630,6 +630,10 @@ public class PeerState2 extends PeerState implements SSU2Payload.PayloadCallback
public void gotTermination(int reason, long count) {
if (_log.shouldInfo())
_log.info("Got TERMINATION block, reason: " + reason + " count: " + count + " on " + this);
if (reason != SSU2Util.REASON_TERMINATION) {
UDPPacket pkt = _transport.getBuilder2().buildSessionDestroyPacket(SSU2Util.REASON_TERMINATION, this);
_transport.send(pkt);
}
_transport.getEstablisher().receiveSessionDestroy(_remoteHostId, this);
}