async_client: Don't request a write lock for crypto based requests.
The crypto state machine is in the base client behind a separate lock so there's no need to require write access. This removes a deadlock if we're trying to send an encrypted message from a event emitter callback, since emitting an event fetches a read lock as well.master
parent
986985464a
commit
6d12ed2046
|
@ -962,7 +962,7 @@ impl AsyncClient {
|
|||
|
||||
let response = self.send(request).await?;
|
||||
self.base_client
|
||||
.write()
|
||||
.read()
|
||||
.await
|
||||
.receive_keys_claim_response(&response)
|
||||
.await?;
|
||||
|
@ -1032,7 +1032,7 @@ impl AsyncClient {
|
|||
|
||||
let response = self.send(request).await?;
|
||||
self.base_client
|
||||
.write()
|
||||
.read()
|
||||
.await
|
||||
.receive_keys_upload_response(&response)
|
||||
.await?;
|
||||
|
@ -1081,7 +1081,7 @@ impl AsyncClient {
|
|||
|
||||
let response = self.send(request).await?;
|
||||
self.base_client
|
||||
.write()
|
||||
.read()
|
||||
.await
|
||||
.receive_keys_query_response(&response)
|
||||
.await?;
|
||||
|
|
Loading…
Reference in New Issue