From 14f61bbbb3857f600ae1a96bb0463177dc40c825 Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 13 Dec 2011 15:16:07 +0000 Subject: [PATCH] * TransportBid: Remove unused stuff --- .../i2p/router/transport/TransportBid.java | 35 +++++++++---------- .../router/transport/TransportManager.java | 4 +-- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/TransportBid.java b/router/java/src/net/i2p/router/transport/TransportBid.java index 6b48ac76d..9606b3572 100644 --- a/router/java/src/net/i2p/router/transport/TransportBid.java +++ b/router/java/src/net/i2p/router/transport/TransportBid.java @@ -17,25 +17,24 @@ import net.i2p.data.RouterInfo; */ public class TransportBid { private int _latencyMs; - private int _bandwidthBytes; - private int _msgSize; - private RouterInfo _router; - private long _bidExpiration; + //private int _bandwidthBytes; + //private int _msgSize; + //private RouterInfo _router; + //private long _bidExpiration; private Transport _transport; public static final int TRANSIENT_FAIL = 999999; public TransportBid() { - setLatencyMs(-1); - setBandwidthBytes(-1); - setMessageSize(-1); - setRouter(null); - setExpiration(0); - setTransport(null); + _latencyMs = -1; + //_bandwidthBytes = -1; + //_msgSize = -1; } /** * How long this transport thinks it would take to send the message + * This is the actual bid value, lower is better, and it doesn't really have + * anything to do with latency. */ public int getLatencyMs() { return _latencyMs; } public void setLatencyMs(int milliseconds) { _latencyMs = milliseconds; } @@ -45,28 +44,28 @@ public class TransportBid { * message successfully * */ - public int getBandwidthBytes() { return _bandwidthBytes; } - public void setBandwidthBytes(int numBytes) { _bandwidthBytes = numBytes; } + //public int getBandwidthBytes() { return _bandwidthBytes; } + //public void setBandwidthBytes(int numBytes) { _bandwidthBytes = numBytes; } /** * How large the message in question is, in bytes * */ - public int getMessageSize() { return _msgSize; } - public void setMessageSize(int numBytes) { _msgSize = numBytes; } + //public int getMessageSize() { return _msgSize; } + //public void setMessageSize(int numBytes) { _msgSize = numBytes; } /** * Router to which the message is to be sent * */ - public RouterInfo getRouter() { return _router; } - public void setRouter(RouterInfo router) { _router = router; } + //public RouterInfo getRouter() { return _router; } + //public void setRouter(RouterInfo router) { _router = router; } /** * Specifies how long this bid is "good for" */ - public long getExpiration() { return _bidExpiration; } - public void setExpiration(long expirationDate) { _bidExpiration = expirationDate; } + //public long getExpiration() { return _bidExpiration; } + //public void setExpiration(long expirationDate) { _bidExpiration = expirationDate; } //public void setExpiration(long expirationDate) { setExpiration(new Date(expirationDate)); } /** diff --git a/router/java/src/net/i2p/router/transport/TransportManager.java b/router/java/src/net/i2p/router/transport/TransportManager.java index 81cf89340..ae4bfe224 100644 --- a/router/java/src/net/i2p/router/transport/TransportManager.java +++ b/router/java/src/net/i2p/router/transport/TransportManager.java @@ -403,7 +403,6 @@ public class TransportManager implements TransportEventListener { return rv; } - @SuppressWarnings("static-access") public TransportBid getNextBid(OutNetMessage msg) { int unreachableTransports = 0; Hash peer = msg.getTarget().getIdentity().calculateHash(); @@ -427,8 +426,7 @@ public class TransportManager implements TransportEventListener { // to us via TCP, send via TCP) TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize()); if (bid != null) { - /* FIXME Accessing static field "TRANSIENT_FAIL" FIXME */ - if (bid.getLatencyMs() == bid.TRANSIENT_FAIL) + if (bid.getLatencyMs() == TransportBid.TRANSIENT_FAIL) // this keeps GetBids() from shitlisting for "no common transports" msg.transportFailed(t.getStyle()); else if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )