Changeset f4fdbce


Ignore:
Timestamp:
May 24, 2009 12:29:18 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e82898c
Parents:
c75ff53
Message:
  • SSU: Don't offer to introduce when near connection limit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java

    rc75ff53 rf4fdbce  
    283283        if (isNew) {
    284284            // we don't expect inbound connections when hidden, but it could happen
    285             if ((!_context.router().isHidden()) && !_transport.introducersRequired()) {
     285            // Don't offer if we are approaching max connections. While Relay Intros do not
     286            // count as connections, we have to keep the connection to this peer up longer if
     287            // we are offering introductions.
     288            if ((!_context.router().isHidden()) && (!_transport.introducersRequired()) && _transport.haveCapacity()) {
    286289                long tag = _context.random().nextLong(MAX_TAG_VALUE);
    287290                state.setSentRelayTag(tag);
     
    571574    private void sendCreated(InboundEstablishState state) {
    572575        long now = _context.clock().now();
    573         if (!_transport.introducersRequired()) {
     576        // don't offer if we are approaching max connections (see comments above)
     577        if ((!_transport.introducersRequired()) && _transport.haveCapacity()) {
    574578            // offer to relay
    575579            // (perhaps we should check our bw usage and/or how many peers we are
Note: See TracChangeset for help on using the changeset viewer.