mpsc tunnel may be stuck by slow tcp stream, should not panic for this (#406)

* mpsc tunnel may be stuck by slow tcp stream, should not panic for this
* disallow node connect to self
This commit is contained in:
Sijie.Sun
2024-10-11 00:12:14 +08:00
committed by GitHub
parent 7ab8cad1af
commit d2291628e0
3 changed files with 56 additions and 11 deletions
+2
View File
@@ -294,6 +294,8 @@ impl PeerConnPinger {
let need_close = if last_rx_packets != current_rx_packets {
// if we receive some packet from peers, we should relax the condition
counter > 50 && loss_rate_1 > 0.5
// TODO: wait more time to see if the loss rate is still high after no rx
} else {
true
};