mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add lock to RawConnection
To avoid `self.writer.drain()` is called in parallel. Reference: https://bugs.python.org/issue29930
This commit is contained in:
@ -21,8 +21,7 @@ class InsecureSession(BaseSession):
|
||||
msg = make_exchange_message(self.local_private_key.get_public_key())
|
||||
msg_bytes = msg.SerializeToString()
|
||||
encoded_msg_bytes = encode_fixedint_prefixed(msg_bytes)
|
||||
self.writer.write(encoded_msg_bytes)
|
||||
await self.writer.drain()
|
||||
await self.write(encoded_msg_bytes)
|
||||
|
||||
msg_bytes_other_side = await read_fixedint_prefixed(self.reader)
|
||||
msg_other_side = plaintext_pb2.Exchange()
|
||||
|
||||
Reference in New Issue
Block a user