mirror of https://github.com/vacp2p/nim-libp2p.git
f46bf0faa4
* remove send lock When mplex receives data it will block until a reader has processed the data. Thus, when a large message is received, such as a gossipsub subscription table, all of mplex will be blocked until all reading is finished. However, if at the same time a `dial` to establish a gossipsub send connection is ongoing, that `dial` will be blocked because mplex is no longer reading data - specifically, it might indeed be the connection that's processing the previous data that is waiting for a send connection. There are other problems with the current code: * If an exception is raised, it is not necessarily raised for the same connection as `p.sendConn`, so resetting `p.sendConn` in the exception handling is wrong * `p.isConnected` is checked before taking the lock - thus, if it returns false, a new dial will be started. If a new task enters `send` before dial is finished, it will also determine `p.isConnected` is false, then get stuck on the lock - when the previous task finishes and releases the lock, the new task will _also_ dial and thus reset `p.sendConn` causing a leak. * prefer existing connection simplifies flow |
||
---|---|---|
.. | ||
pubsub | ||
helpers.nim | ||
nim.cfg | ||
testbufferstream.nim | ||
testcid.nim | ||
testconnection.nim | ||
testconnmngr.nim | ||
testcrypto.nim | ||
testdaemon.nim | ||
testecnist.nim | ||
tested25519.nim | ||
testidentify.nim | ||
testinterop.nim | ||
testminasn1.nim | ||
testminprotobuf.nim | ||
testmplex.nim | ||
testmultiaddress.nim | ||
testmultibase.nim | ||
testmultihash.nim | ||
testmultistream.nim | ||
testnative.nim | ||
testnoise.nim | ||
testpeer.nim | ||
testpeerinfo.nim | ||
testpkifilter.nim | ||
testrsa.nim | ||
testsecp256k1.nim | ||
teststreamseq.nim | ||
testswitch.nim | ||
testtransport.nim | ||
testvarint.nim |