Enable tunnel testing when in hidden mode (ticket #1192)

Enable tunnel testing when without addresses (ticket #1835)
Use fast peers for inbound tunnels when without addresses (ticket #1835)
This commit is contained in:
zzz
2016-08-19 17:13:12 +00:00
parent 268953e19f
commit be5fdea5e1
5 changed files with 38 additions and 4 deletions

View File

@ -1,3 +1,23 @@
2016-08-19 zzz
* CPUID: Add IDs for Kaby Lake
* JettyStart: Fix main()
* Router: Fix return code in getShutdownTimeRemaining()
* Tunnels:
- Enable tunnel testing when in hidden mode (ticket #1192)
- Enable tunnel testing when without addresses (ticket #1835)
- Use fast peers for inbound tunnels when without addresses (ticket #1835)
2016-08-14 zzz
* i2ptunnel:
- Register actual listen host with port mapper
- Register POP and SMTP ports with port mapper
* Reseed: Add new 'atomike' reseed
2016-08-12 zzz
* i2ptunnel:
- Add outproxy plugin support to SOCKS (ticket #1824)
- Use preferred sigtype for new SOCKS tunnels
2016-08-09 zzz
* Console: Fix UPnP NPE on /peers (ticket #1830)

View File

@ -180,6 +180,16 @@ public class RouterInfo extends DatabaseEntry {
_published = published;
}
/**
* Return the number of router addresses.
* More efficient than getAddresses().size()
*
* @since 0.9.27
*/
public int getAddressCount() {
return _addresses.size();
}
/**
* Retrieve the set of RouterAddress structures at which this
* router can be contacted.

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 9;
public final static long BUILD = 10;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -66,7 +66,9 @@ class ExploratoryPeerSelector extends TunnelPeerSelector {
// If hidden and inbound, use fast peers - that we probably have recently
// connected to and so they have our real RI - to maximize the chance
// that the adjacent hop can connect to us.
if (settings.isInbound() && ctx.router().isHidden()) {
if (settings.isInbound() &&
(ctx.router().isHidden() ||
ctx.router().getRouterInfo().getAddressCount() <= 0)) {
if (l.shouldLog(Log.INFO))
l.info("EPS SFP " + length + (settings.isInbound() ? " IB" : " OB") + " exclude " + exclude.size());
ctx.profileOrganizer().selectFastPeers(length, exclude, matches);

View File

@ -556,8 +556,10 @@ public class TunnelPoolManager implements TunnelManagerFacade {
/** queue a recurring test job if appropriate */
void buildComplete(PooledTunnelCreatorConfig cfg) {
if (cfg.getLength() > 1 &&
(!_context.router().gracefulShutdownInProgress()) &&
!_context.getBooleanPropertyDefaultTrue("router.disableTunnelTesting")) {
!_context.router().gracefulShutdownInProgress() &&
(!_context.getBooleanPropertyDefaultTrue("router.disableTunnelTesting") ||
_context.router().isHidden() ||
_context.router().getRouterInfo().getAddressCount() <= 0)) {
TunnelPool pool = cfg.getTunnelPool();
if (pool == null) {
// never seen this before, do we reallly need to bother