SSU2: Immediately remove establish state from EstablishmentManager on fatal error

to free up space and prevent problems handling additional packets
This commit is contained in:
zzz
2022-12-17 09:17:55 -05:00
parent 67d20d4af5
commit 05d60d70e2

View File

@@ -775,6 +775,8 @@ class EstablishmentManager {
} catch (GeneralSecurityException gse) {
if (_log.shouldWarn())
_log.warn("Corrupt Session/Token Request after Retry from: " + state, gse);
// state called fail()
_inboundStates.remove(state.getRemoteHostId());
return;
}
}
@@ -881,6 +883,7 @@ class EstablishmentManager {
if (_log.shouldWarn())
_log.warn("Corrupt Session Confirmed on: " + state, gse);
// state called fail()
_inboundStates.remove(state.getRemoteHostId());
return;
}
InboundEstablishState.InboundState istate = state.getState();
@@ -933,6 +936,7 @@ class EstablishmentManager {
if (_log.shouldWarn())
_log.warn("Corrupt Session Created on: " + state, gse);
// state called fail()
_outboundStates.remove(state.getRemoteHostId());
return;
}
notifyActivity();
@@ -953,6 +957,7 @@ class EstablishmentManager {
if (_log.shouldWarn())
_log.warn("Corrupt Retry from: " + state, gse);
// state called fail()
_outboundStates.remove(state.getRemoteHostId());
return;
}
notifyActivity();