crypto: Don't await while holding a sync lock

master
Damir Jelić 2021-05-27 16:24:00 +02:00
parent 12619ab8b3
commit 8a5a0e511e
1 changed files with 4 additions and 2 deletions

View File

@ -389,7 +389,9 @@ impl VerificationRequest {
) -> Result<(), CryptoStoreError> {
let content = content.into();
if let InnerRequest::Ready(s) = &*self.inner.lock().unwrap() {
let inner = self.inner.lock().unwrap().clone();
if let InnerRequest::Ready(s) = inner {
s.receive_start(sender, content).await?;
} else {
warn!(
@ -433,7 +435,7 @@ impl VerificationRequest {
}
}
#[derive(Debug)]
#[derive(Clone, Debug)]
enum InnerRequest {
Created(RequestState<Created>),
Requested(RequestState<Requested>),