crypto: Remove verification objects that are done or canceled.
parent
01ba94c670
commit
9f0fbcccf6
|
@ -1094,6 +1094,8 @@ impl OlmMachine {
|
||||||
/// * `response` - The sync latest sync response.
|
/// * `response` - The sync latest sync response.
|
||||||
#[instrument(skip(response))]
|
#[instrument(skip(response))]
|
||||||
pub async fn receive_sync_response(&mut self, response: &mut SyncResponse) {
|
pub async fn receive_sync_response(&mut self, response: &mut SyncResponse) {
|
||||||
|
self.verification_machine.garbage_collect();
|
||||||
|
|
||||||
let one_time_key_count = response
|
let one_time_key_count = response
|
||||||
.device_one_time_keys_count
|
.device_one_time_keys_count
|
||||||
.get(&keys::KeyAlgorithm::SignedCurve25519);
|
.get(&keys::KeyAlgorithm::SignedCurve25519);
|
||||||
|
|
|
@ -81,6 +81,11 @@ impl VerificationMachine {
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn garbage_collect(&self) {
|
||||||
|
self.verifications
|
||||||
|
.retain(|_, s| !(s.is_canceled() || s.is_done()));
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn receive_event(
|
pub async fn receive_event(
|
||||||
&self,
|
&self,
|
||||||
event: &mut AnyToDeviceEvent,
|
event: &mut AnyToDeviceEvent,
|
||||||
|
|
Loading…
Reference in New Issue