From 82d5bc10802a81208c453adce71c8df3e5913a90 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Mon, 24 Jul 2023 14:34:29 -0400 Subject: [PATCH] Router: also allow filtering slow routers in exploratory, client tunnels --- .../router/tunnel/pool/TunnelPeerSelector.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java index 9b71efb11b..8bf0665e58 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java @@ -437,25 +437,27 @@ private boolean filterUnreachable(boolean isInbound, boolean isExploratory) { 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 */