2005-07-13 jrandom
* Fixed a recently injected bug in the multitransport bidding which had allowed an essentially arbitrary choice of transports, rather than the properly ordered choice. (getLatency() != getLatencyMs(). duh)
This commit is contained in:
@ -1,4 +1,9 @@
|
|||||||
$Id: history.txt,v 1.210 2005/07/12 16:26:07 jrandom Exp $
|
$Id: history.txt,v 1.211 2005/07/13 13:20:43 jrandom Exp $
|
||||||
|
|
||||||
|
2005-07-13 jrandom
|
||||||
|
* Fixed a recently injected bug in the multitransport bidding which had
|
||||||
|
allowed an essentially arbitrary choice of transports, rather than the
|
||||||
|
properly ordered choice.
|
||||||
|
|
||||||
2005-07-13 jrandom
|
2005-07-13 jrandom
|
||||||
* Fixed a long standing bug where we weren't properly comparing session
|
* Fixed a long standing bug where we weren't properly comparing session
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.201 $ $Date: 2005/07/12 16:26:07 $";
|
public final static String ID = "$Revision: 1.202 $ $Date: 2005/07/13 13:20:43 $";
|
||||||
public final static String VERSION = "0.5.0.7";
|
public final static String VERSION = "0.5.0.7";
|
||||||
public final static long BUILD = 13;
|
public final static long BUILD = 14;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION);
|
System.out.println("I2P Router version: " + VERSION);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
@ -65,6 +65,8 @@ public class GetBidsJob extends JobImpl {
|
|||||||
context.netDb().fail(to);
|
context.netDb().fail(to);
|
||||||
fail(context, msg);
|
fail(context, msg);
|
||||||
} else {
|
} else {
|
||||||
|
if (log.shouldLog(Log.INFO))
|
||||||
|
log.info("Attempting to send on transport " + bid.getTransport().getStyle() + ": " + bid);
|
||||||
bid.getTransport().send(msg);
|
bid.getTransport().send(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,10 +175,11 @@ public class TransportManager implements TransportEventListener {
|
|||||||
// to us via TCP, send via TCP)
|
// to us via TCP, send via TCP)
|
||||||
TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
|
TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
|
||||||
if (bid != null) {
|
if (bid != null) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
|
||||||
_log.debug("Transport " + t.getStyle() + " bid: " + bid);
|
|
||||||
if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
|
if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
|
||||||
rv = bid;
|
rv = bid;
|
||||||
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
|
_log.debug("Transport " + t.getStyle() + " bid: " + bid + " currently winning? " + (rv == bid)
|
||||||
|
+ " (winning latency: " + rv.getLatencyMs() + " / " + rv + ")");
|
||||||
} else {
|
} else {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Transport " + t.getStyle() + " did not produce a bid");
|
_log.debug("Transport " + t.getStyle() + " did not produce a bid");
|
||||||
|
@ -834,10 +834,8 @@ public class TCPTransport extends TransportImpl {
|
|||||||
* Cache the bid to reduce object churn
|
* Cache the bid to reduce object churn
|
||||||
*/
|
*/
|
||||||
private class SharedBid extends TransportBid {
|
private class SharedBid extends TransportBid {
|
||||||
private int _ms;
|
public SharedBid(int ms) { super(); setLatencyMs(ms); }
|
||||||
public SharedBid(int ms) { _ms = ms; }
|
|
||||||
public int getLatency() { return _ms; }
|
|
||||||
public Transport getTransport() { return TCPTransport.this; }
|
public Transport getTransport() { return TCPTransport.this; }
|
||||||
public String toString() { return "TCP bid @ " + _ms; }
|
public String toString() { return "TCP bid @ " + getLatencyMs(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,7 +476,7 @@ public class EstablishmentManager {
|
|||||||
break;
|
break;
|
||||||
_transport.failed(msg);
|
_transport.failed(msg);
|
||||||
}
|
}
|
||||||
_context.shitlist().shitlistRouter(outboundState.getRemoteIdentity().calculateHash(), "Unable to establish");
|
_context.shitlist().shitlistRouter(outboundState.getRemoteIdentity().calculateHash(), "Unable to establish with SSU");
|
||||||
} else {
|
} else {
|
||||||
while (true) {
|
while (true) {
|
||||||
OutNetMessage msg = outboundState.getNextQueuedMessage();
|
OutNetMessage msg = outboundState.getNextQueuedMessage();
|
||||||
|
@ -245,7 +245,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void externalAddressReceived(byte ourIP[], int ourPort) {
|
void externalAddressReceived(byte ourIP[], int ourPort) {
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("External address received: " + Base64.encode(ourIP) + ":" + ourPort);
|
_log.debug("External address received: " + Base64.encode(ourIP) + ":" + ourPort);
|
||||||
|
|
||||||
if (explicitAddressSpecified())
|
if (explicitAddressSpecified())
|
||||||
@ -308,8 +308,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
boolean addRemotePeerState(PeerState peer) {
|
boolean addRemotePeerState(PeerState peer) {
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.debug("Add remote peer state: " + peer);
|
_log.info("Add remote peer state: " + peer);
|
||||||
if (peer.getRemotePeer() != null) {
|
if (peer.getRemotePeer() != null) {
|
||||||
synchronized (_peersByIdent) {
|
synchronized (_peersByIdent) {
|
||||||
PeerState oldPeer = (PeerState)_peersByIdent.put(peer.getRemotePeer(), peer);
|
PeerState oldPeer = (PeerState)_peersByIdent.put(peer.getRemotePeer(), peer);
|
||||||
@ -347,8 +347,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
dropPeer(peer, true);
|
dropPeer(peer, true);
|
||||||
}
|
}
|
||||||
private void dropPeer(PeerState peer, boolean shouldShitlist) {
|
private void dropPeer(PeerState peer, boolean shouldShitlist) {
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.debug("Dropping remote peer: " + peer);
|
_log.info("Dropping remote peer: " + peer);
|
||||||
if (peer.getRemotePeer() != null) {
|
if (peer.getRemotePeer() != null) {
|
||||||
if (shouldShitlist) {
|
if (shouldShitlist) {
|
||||||
long now = _context.clock().now();
|
long now = _context.clock().now();
|
||||||
@ -519,6 +519,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
addr.setOptions(options);
|
addr.setOptions(options);
|
||||||
|
|
||||||
_externalAddress = addr;
|
_externalAddress = addr;
|
||||||
|
if (_log.shouldLog(Log.INFO))
|
||||||
|
_log.info("Address rebuilt: " + addr);
|
||||||
replaceAddress(addr);
|
replaceAddress(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,11 +699,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
* Cache the bid to reduce object churn
|
* Cache the bid to reduce object churn
|
||||||
*/
|
*/
|
||||||
private class SharedBid extends TransportBid {
|
private class SharedBid extends TransportBid {
|
||||||
private int _ms;
|
public SharedBid(int ms) { super(); setLatencyMs(ms); }
|
||||||
public SharedBid(int ms) { _ms = ms; }
|
|
||||||
public int getLatency() { return _ms; }
|
|
||||||
public Transport getTransport() { return UDPTransport.this; }
|
public Transport getTransport() { return UDPTransport.this; }
|
||||||
public String toString() { return "UDP bid @ " + _ms; }
|
public String toString() { return "UDP bid @ " + getLatencyMs(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ExpirePeerEvent implements SimpleTimer.TimedEvent {
|
private class ExpirePeerEvent implements SimpleTimer.TimedEvent {
|
||||||
|
Reference in New Issue
Block a user