mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
bypass slow transport sessions
This commit is contained in:
parent
60e648bf9a
commit
cd1af85e39
6 changed files with 28 additions and 6 deletions
|
@ -906,9 +906,10 @@ namespace transport
|
|||
return GetRandomPeer (
|
||||
[isHighBandwidth](const Peer& peer)->bool
|
||||
{
|
||||
// connected and not overloaded
|
||||
return !peer.router && !peer.sessions.empty () &&
|
||||
// connected, not overloaded and not slow
|
||||
return !peer.router && !peer.sessions.empty () && peer.isReachable &&
|
||||
peer.sessions.front ()->GetSendQueueSize () <= PEER_ROUTER_INFO_OVERLOAD_QUEUE_SIZE &&
|
||||
!peer.sessions.front ()->IsSlow () &&
|
||||
(!isHighBandwidth || peer.isHighBandwidth);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue