libp2p / jvm-libp2p

a libp2p implementation for the JVM, written in Kotlin 🔥
https://libp2p.io
Apache License 2.0
260 stars 74 forks source link

[Yamux] Don't send frame if send buffer is not empty #332

Closed StefanBratanov closed 11 months ago

StefanBratanov commented 11 months ago

There could be a race condition case where a frame is being sent before the send buffer has been flushed, which would result in unordered frames. Very hard to replicate in actual test, so wrote a generic test to test order of messages when send buffer is used.