merge of '3f85581f65aedde0f96729d197aaab223174f2e4'

and '6df9f4e154d148867ee158cbe9e9acf3fb73d680'
This commit is contained in:
dg2-new
2013-11-10 22:22:10 +00:00
23 changed files with 15 additions and 37 deletions

View File

@ -374,8 +374,7 @@ public class MessageHistory {
buf.append(getPrefix());
buf.append("timed out waiting for a reply to [").append(sentMessage.getMessageType());
buf.append("] [").append(sentMessage.getMessageId()).append("] expiring on [");
if (sentMessage != null)
buf.append(getTime(sentMessage.getReplySelector().getExpiration()));
buf.append(getTime(sentMessage.getReplySelector().getExpiration()));
buf.append("] ").append(sentMessage.getReplySelector().toString());
addEntry(buf.toString());
}

View File

@ -86,7 +86,7 @@ public class StatisticsManager implements Service {
if (_context.getBooleanPropertyDefaultTrue(PROP_PUBLISH_RANKINGS) &&
_context.random().nextInt(RANDOM_INCLUDE_STATS) == 0) {
long publishedUptime = _context.router().getUptime();
//long publishedUptime = _context.router().getUptime();
// Don't publish these for first hour
// Disabled in 0.9
//if (publishedUptime > 62*60*1000)

View File

@ -283,7 +283,6 @@ public class TunnelPoolSettings {
}
private static final boolean getBoolean(String str, boolean defaultValue) {
if (str == null) return defaultValue;
boolean v = Boolean.parseBoolean(str) ||
(str != null && "YES".equals(str.toUpperCase(Locale.US)));
return v;

View File

@ -223,7 +223,6 @@ public class HandleDatabaseLookupMessageJob extends JobImpl {
private static boolean isUnreachable(RouterInfo info) {
if (info == null) return true;
String cap = info.getCapabilities();
if (cap == null) return false;
return cap.indexOf(Router.CAPABILITY_REACHABLE) >= 0;
}

View File

@ -310,8 +310,6 @@ class FloodfillPeerSelector extends PeerSelector {
if (pinfo == null)
return rv;
Collection<RouterAddress> paddr = pinfo.getAddresses();
if (paddr == null)
return rv;
for (RouterAddress pa : paddr) {
byte[] pib = pa.getIP();
if (pib == null) continue;

View File

@ -926,7 +926,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
*/
void dropAfterLookupFailed(Hash peer) {
_context.peerManager().removeCapabilities(peer);
boolean removed = _kb.remove(peer);
_kb.remove(peer);
//if (removed) {
// if (_log.shouldLog(Log.INFO))
// _log.info("Removed kbucket entry for " + peer);

View File

@ -1270,8 +1270,6 @@ public class ProfileOrganizer {
if (pinfo == null)
return rv;
Collection<RouterAddress> paddr = pinfo.getAddresses();
if (paddr == null)
return rv;
for (RouterAddress pa : paddr) {
byte[] pib = pa.getIP();
if (pib == null) continue;

View File

@ -139,12 +139,10 @@ public class OutboundMessageRegistry {
if (o instanceof OutNetMessage) {
msg = (OutNetMessage)o;
if (msg != null)
rv.add(msg);
rv.add(msg);
} else if (o instanceof List) {
msgs = (List<OutNetMessage>)o;
if (msgs != null)
rv.addAll(msgs);
rv.addAll(msgs);
}
}
if (removed) {

View File

@ -229,7 +229,7 @@ public class DHSessionKeyBuilder {
//_peerValue = new NativeBigInteger(val);
}
public BigInteger getPeerPublicValue() {
public synchronized BigInteger getPeerPublicValue() {
return _peerValue;
}

View File

@ -952,8 +952,7 @@ public class NTCPTransport extends TransportImpl {
}
} else if (enabled.equals("false") &&
name != null && name.length() > 0 &&
!name.equals(ohost) &&
nport != null) {
!name.equals(ohost)) {
// Host name is configured, and we have a port (either auto or configured)
// but we probably only get here if the port is auto,
// otherwise createNTCPAddress() would have done it already

View File

@ -1306,7 +1306,7 @@ class EstablishmentManager {
_outboundByHash.remove(outboundState.getRemoteIdentity().calculateHash(), outboundState);
// should have already been removed in handleOutbound() above
// remove only if value == state
boolean removed = _outboundStates.remove(outboundState.getRemoteHostId(), outboundState);
_outboundStates.remove(outboundState.getRemoteHostId(), outboundState);
if (outboundState.getState() != OB_STATE_CONFIRMED_COMPLETELY) {
if (_log.shouldLog(Log.INFO))
_log.info("Expired: " + outboundState + " Lifetime: " + outboundState.getLifetime());

View File

@ -150,7 +150,6 @@ class OutboundMessageFragments {
*
*/
public void add(OutNetMessage msg) {
I2NPMessage msgBody = msg.getMessage();
RouterInfo target = msg.getTarget();
if (target == null)
return;

View File

@ -58,7 +58,7 @@ class OutboundTunnelEndpoint {
if (_log.shouldLog(Log.DEBUG))
_log.debug("outbound tunnel " + _config + " received a full message: " + msg
+ " to be forwarded on to "
+ (toRouter != null ? toRouter.toBase64().substring(0,4) : "")
+ toRouter.toBase64().substring(0,4)
+ (toTunnel != null ? ":" + toTunnel.getTunnelId() : ""));
int size = msg.getMessageSize();
// don't drop it if we are the target

View File

@ -348,9 +348,6 @@ public abstract class TunnelPeerSelector {
private static boolean shouldExclude(RouterContext ctx, Log log, RouterInfo peer, char excl[]) {
String cap = peer.getCapabilities();
if (cap == null) {
return true;
}
for (int j = 0; j < excl.length; j++) {
if (cap.indexOf(excl[j]) >= 0) {
return true;