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
Damir Jelić 2020-04-23 14:56:59 +02:00
parent 986985464a
commit 6d12ed2046
1 changed files with 3 additions and 3 deletions

View File

@ -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?;