Changeset 8faeaaa


Ignore:
Timestamp:
Jan 5, 2009 3:16:14 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4f836a2
Parents:
7271289
Message:

Transport: Don't shitlist a peer if we are at our connection limit

Location:
router/java/src/net/i2p/router/transport
Files:
5 edited

Legend:

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

    r7271289 r8faeaaa  
    6767            if (failedCount == 0) {
    6868                context.statManager().addRateData("transport.bidFailNoTransports", msg.getLifetime(), 0);
    69                 context.shitlist().shitlistRouter(to, "We share no common transports with them");
     69                // This used to be "no common transports" but it is almost always no transports at all
     70                context.shitlist().shitlistRouter(to, "No transports (hidden or starting up?)");
    7071            } else if (failedCount >= facade.getTransportCount()) {
    7172                context.statManager().addRateData("transport.bidFailAllTransports", msg.getLifetime(), 0);
  • router/java/src/net/i2p/router/transport/TransportBid.java

    r7271289 r8faeaaa  
    2424    private Transport _transport;
    2525   
     26    public static final int TRANSIENT_FAIL = 999999;
     27
    2628    public TransportBid() {
    2729        setLatencyMs(-1);
  • router/java/src/net/i2p/router/transport/TransportManager.java

    r7271289 r8faeaaa  
    302302            TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
    303303            if (bid != null) {
    304                 if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
     304                if (bid.getLatencyMs() == bid.TRANSIENT_FAIL)
     305                    // this keeps GetBids() from shitlisting for "no common transports"
     306                    msg.transportFailed(t.getStyle());
     307                else if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
    305308                    rv = bid;   
    306309                if (_log.shouldLog(Log.DEBUG))
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r7271289 r8faeaaa  
    3737    private SharedBid _fastBid;
    3838    private SharedBid _slowBid;
     39    private SharedBid _transientFail;
    3940    private Object _conLock;
    4041    private Map _conByIdent;
     
    132133        _fastBid = new SharedBid(25); // best
    133134        _slowBid = new SharedBid(70); // better than ssu unestablished, but not better than ssu established
     135        _transientFail = new SharedBid(TransportBid.TRANSIENT_FAIL);
    134136    }
    135137   
     
    290292            if (_log.shouldLog(Log.WARN))
    291293                _log.warn("no bid when trying to send to " + toAddress.getIdentity().calculateHash().toBase64() + ", max connection limit reached");
    292             return null;
     294            return _transientFail;
    293295        }
    294296
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r7271289 r8faeaaa  
    8787    /** shared slow bid for unconnected peers when we want to always prefer UDP */
    8888    private TransportBid _slowPreferredBid;
     89    private TransportBid _transientFail;
    8990   
    9091    /** list of RemoteHostId for peers whose packets we want to drop outright */
     
    158159        _slowPreferredBid = new SharedBid(20);
    159160        _slowestBid = new SharedBid(1000);
     161        _transientFail = new SharedBid(TransportBid.TRANSIENT_FAIL);
    160162       
    161163        _fragments = new OutboundMessageFragments(_context, this, _activeThrottle);
     
    892894            }
    893895            if (!allowConnection())
    894                 return null;
     896                return _transientFail;
    895897
    896898            if (_log.shouldLog(Log.DEBUG))
Note: See TracChangeset for help on using the changeset viewer.