Changeset b43338bd


Ignore:
Timestamp:
May 28, 2009 4:19:55 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e65c2e2
Parents:
65ae9138
Message:
  • Transports:
    • Adjust bids when near conn capacity
    • peers.jsp HTML fixes
Location:
router/java/src/net/i2p/router/transport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r65ae9138 rb43338bd  
    3737    private SharedBid _fastBid;
    3838    private SharedBid _slowBid;
     39    /** save some conns for inbound */
     40    private SharedBid _nearCapacityBid;
    3941    private SharedBid _transientFail;
    4042    private final Object _conLock;
     
    134136        _fastBid = new SharedBid(25); // best
    135137        _slowBid = new SharedBid(70); // better than ssu unestablished, but not better than ssu established
     138        _nearCapacityBid = new SharedBid(90); // not better than ssu - save our conns for inbound
    136139        _transientFail = new SharedBid(TransportBid.TRANSIENT_FAIL);
    137140    }
     
    309312        if (_log.shouldLog(Log.DEBUG))
    310313            _log.debug("slow bid when trying to send to " + peer.toBase64());
    311         return _slowBid;
     314        if (haveCapacity())
     315            return _slowBid;
     316        else
     317            return _nearCapacityBid;
    312318    }
    313319
     
    661667            //if (ip != null)
    662668            //    buf.append(' ').append(_context.blocklist().toStr(ip));
    663             buf.append("</code></td><td align=\"center\"><code>");
     669            buf.append("</td><td align=\"center\"><code>");
    664670            if (con.isInbound())
    665671                buf.append("in");
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r65ae9138 rb43338bd  
    8282    /** shared slow bid for unconnected peers when we want to prefer UDP */
    8383    private TransportBid _slowBid;
     84    /** save some conns for inbound */
     85    private TransportBid _nearCapacityBid;
    8486    /** shared slow bid for unconnected peers */
    8587    private TransportBid _slowestBid;
     
    171173        _fastPreferredBid = new SharedBid(15);
    172174        _slowPreferredBid = new SharedBid(20);
    173         _slowestBid = new SharedBid(1000);
     175        _slowestBid = new SharedBid(80);
     176        _nearCapacityBid = new SharedBid(100);
    174177        _transientFail = new SharedBid(TransportBid.TRANSIENT_FAIL);
    175178       
     
    989992            else if (preferUDP())
    990993                return _slowBid;
     994            else if (haveCapacity())
     995                return _slowestBid;
    991996            else
    992                 return _slowestBid;
     997                return _nearCapacityBid;
    993998        }
    994999    }
     
    17611766        if (sortFlags != FLAG_ALPHA)
    17621767            buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
    1763         buf.append("</td><td>dir/intro</td><td><b><a href=\"#def.idle\">Idle</a></b>");
     1768        buf.append("</td><td><b><a href=\"#def.dir\">Dir/Intro</a></b></td><td><b><a href=\"#def.idle\">Idle</a></b>");
    17641769        appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN);
    17651770        buf.append("/");
     
    18141819            //if (ip != null)
    18151820            //    buf.append(' ').append(_context.blocklist().toStr(ip));
    1816             buf.append("</td><td>");
     1821            buf.append("</td><td><code>");
    18171822            if (peer.isInbound())
    18181823                buf.append("in ");
Note: See TracChangeset for help on using the changeset viewer.