vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
249 stars 54 forks source link

feat: Yamux timeout #1029

Closed lchenut closed 7 months ago

lchenut commented 7 months ago

This PR adds a timeout to Yamux so that it works in the same way as Mplex. Adds a couple of tests. Fixes a bug revealed by tests where result.reset() called Future[void].reset() instead of YamuxStream.reset()

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7faa0fa) 83.15% compared to head (14b9ed2) 83.22%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029/graphs/tree.svg?width=650&height=150&src=pr&token=UR5JRQ249W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) ```diff @@ Coverage Diff @@ ## unstable #1029 +/- ## ============================================ + Coverage 83.15% 83.22% +0.07% ============================================ Files 91 91 Lines 15351 15362 +11 ============================================ + Hits 12765 12785 +20 + Misses 2586 2577 -9 ``` | [Files](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [libp2p/builders.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL2J1aWxkZXJzLm5pbQ==) | `93.91% <100.00%> (+0.16%)` | :arrow_up: | | [libp2p/muxers/yamux/yamux.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL211eGVycy95YW11eC95YW11eC5uaW0=) | `91.42% <100.00%> (+0.75%)` | :arrow_up: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1029/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)