Changeset c3181d85 for router


Ignore:
Timestamp:
Nov 10, 2016 3:09:39 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
aeeee0e
Parents:
24ecc85
Message:

Transport: Use NTCP for some outbound connections even before
SSU minimums are met (ticket #1835)

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterVersion.java

    r24ecc85 rc3181d85  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 7;
     21    public final static long BUILD = 8;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r24ecc85 rc3181d85  
    17701770            // never get any introducers)
    17711771            int count = _peersByIdent.size();
    1772             if (alwaysPreferUDP() || count < _min_peers ||
    1773                 (_haveIPv6Address && count < _min_v6_peers) ||
    1774                 (introducersRequired() && _introManager.introducerCount() < MIN_INTRODUCER_POOL))
     1772            if (alwaysPreferUDP()) {
    17751773                return _cachedBid[SLOW_PREFERRED_BID];
    1776             else if (preferUDP())
     1774            } else if (count < _min_peers ||
     1775                       (_haveIPv6Address && count < _min_v6_peers) ||
     1776                       (introducersRequired() && _introManager.introducerCount() < MIN_INTRODUCER_POOL)) {
     1777                 // Even if we haven't hit our minimums, give NTCP a chance some of the time.
     1778                 // This may make things work a little faster at startup
     1779                 // (especially when we have an IPv6 address and the increased minimums),
     1780                 // and if UDP is completely blocked we'll still have some connectivity.
     1781                 // TODO After some time, decide that UDP is blocked/broken and return TRANSIENT_FAIL_BID?
     1782                if (_context.random().nextInt(4) == 0)
     1783                    return _cachedBid[SLOWEST_BID];
     1784                else
     1785                    return _cachedBid[SLOW_PREFERRED_BID];
     1786            } else if (preferUDP()) {
    17771787                return _cachedBid[SLOW_BID];
    1778             else if (haveCapacity()) {
     1788            } else if (haveCapacity()) {
    17791789                if (addr.getCost() > DEFAULT_COST)
    17801790                    return _cachedBid[SLOWEST_COST_BID];
Note: See TracChangeset for help on using the changeset viewer.