- Have SSU bid aggressively when it has less than 3 peers, so

we can determine our IP address and do peer testing.
        Otherwise a router may never determine its IP address or reachability status.
This commit is contained in:
zzz
2008-05-05 13:57:54 +00:00
parent 65ec41c48f
commit b1af22a15e

View File

@ -863,7 +863,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("bidding on a message to an unestablished peer: " + to.toBase64()); _log.debug("bidding on a message to an unestablished peer: " + to.toBase64());
if (alwaysPreferUDP())
// Try to maintain at least 3 peers so we can determine our IP address and
// we have a selection to run peer tests with.
int count;
synchronized (_peersByIdent) {
count = _peersByIdent.size();
}
if (alwaysPreferUDP() || count < 3)
return _slowPreferredBid; return _slowPreferredBid;
else if (preferUDP()) else if (preferUDP())
return _slowBid; return _slowBid;