mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 07:30:55 +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:
@ -150,8 +150,7 @@ class Mplex(IMuxedConn):
|
||||
:param _bytes: byte array to write
|
||||
:return: length written
|
||||
"""
|
||||
self.conn.writer.write(_bytes)
|
||||
await self.conn.writer.drain()
|
||||
await self.conn.write(_bytes)
|
||||
return len(_bytes)
|
||||
|
||||
async def handle_incoming(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user