Compare commits

...

2 Commits

View File

@ -408,31 +408,27 @@ public abstract class TunnelPeerSelector extends ConnectChecker {
* @return true if yes
*/
private boolean filterUnreachable(boolean isInbound, boolean isExploratory) {
if (!isExploratory)
if (ctx.router().isHidden())
return true;
// give them some cover without killing our success rate
return ctx.random().nextInt(4) != 0;
/*
if (SystemVersion.isSlow() || ctx.router().getUptime() < 65*60*1000)
return true;
if (ctx.random().nextInt(4) != 0) {
// give them some cover without killing our success rate
return true;
}
if (isExploratory) {
if (isInbound) {
if (ctx.router().isHidden())
return true;
return ctx.getProperty(PROP_INBOUND_EXPLORATORY_EXCLUDE_UNREACHABLE, DEFAULT_INBOUND_EXPLORATORY_EXCLUDE_UNREACHABLE);
} else {
return ctx.getProperty(PROP_OUTBOUND_EXPLORATORY_EXCLUDE_UNREACHABLE, DEFAULT_OUTBOUND_EXPLORATORY_EXCLUDE_UNREACHABLE);
}
} else {
if (isInbound) {
if (ctx.router().isHidden())
return true;
return ctx.getProperty(PROP_INBOUND_CLIENT_EXCLUDE_UNREACHABLE, DEFAULT_INBOUND_CLIENT_EXCLUDE_UNREACHABLE);
} else {
return ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_UNREACHABLE, DEFAULT_OUTBOUND_CLIENT_EXCLUDE_UNREACHABLE);
}
}
*/
}
@ -441,25 +437,27 @@ public abstract class TunnelPeerSelector extends ConnectChecker {
private static final String PROP_INBOUND_EXPLORATORY_EXCLUDE_SLOW = "router.inboundExploratoryExcludeSlow";
private static final String PROP_INBOUND_CLIENT_EXCLUDE_SLOW = "router.inboundClientExcludeSlow";
private static final boolean DEFAULT_OUTBOUND_EXPLORATORY_EXCLUDE_SLOW = false;
private static final boolean DEFAULT_OUTBOUND_CLIENT_EXCLUDE_SLOW = true;
private static final boolean DEFAULT_INBOUND_EXPLORATORY_EXCLUDE_SLOW = false;
private static final boolean DEFAULT_INBOUND_CLIENT_EXCLUDE_SLOW = true;
/**
* do we want to skip peers that are slow?
* @return true unless configured otherwise
*/
protected boolean filterSlow(boolean isInbound, boolean isExploratory) {
return true;
/*
if (isExploratory) {
if (isInbound)
return ctx.getProperty(PROP_INBOUND_EXPLORATORY_EXCLUDE_SLOW, true);
return ctx.getProperty(PROP_INBOUND_EXPLORATORY_EXCLUDE_SLOW, DEFAULT_INBOUND_EXPLORATORY_EXCLUDE_SLOW);
else
return ctx.getProperty(PROP_OUTBOUND_EXPLORATORY_EXCLUDE_SLOW, true);
return ctx.getProperty(PROP_OUTBOUND_EXPLORATORY_EXCLUDE_SLOW, DEFAULT_OUTBOUND_EXPLORATORY_EXCLUDE_SLOW);
} else {
if (isInbound)
return ctx.getProperty(PROP_INBOUND_CLIENT_EXCLUDE_SLOW, true);
return ctx.getProperty(PROP_INBOUND_CLIENT_EXCLUDE_SLOW, DEFAULT_INBOUND_CLIENT_EXCLUDE_SLOW);
else
return ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_SLOW, true);
return ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_SLOW, DEFAULT_OUTBOUND_CLIENT_EXCLUDE_SLOW);
}
*/
}
/** see HashComparator */