From 39ba081384b096184b813fb46c892b08bbd7ffc6 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 7 Oct 2011 15:44:06 +0000 Subject: [PATCH] * Reseed: - Restore ovh reseeds, thx mathiasdm * Tunnels: - For expl. tunnels, fall back to high cap sooner - Tweak build rejections for class N --- history.txt | 7 ++++++- .../src/net/i2p/router/RouterVersion.java | 2 +- .../i2p/router/networkdb/reseed/Reseeder.java | 6 +++--- .../i2p/router/tunnel/pool/BuildHandler.java | 19 +++++++++++++------ .../tunnel/pool/ExploratoryPeerSelector.java | 5 +++-- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/history.txt b/history.txt index b34408739..6d9d15f3c 100644 --- a/history.txt +++ b/history.txt @@ -11,7 +11,12 @@ - SusiMail: de and es 2011-10-07 zzz - * Add https reseed thx h2ik + * Reseed: + - Add an https reseed, thx h2ik + - Restore ovh reseeds, thx mathiasdm + * Tunnels: + - For expl. tunnels, fall back to high cap sooner + - Tweak build rejections for class N 2011-10-06 kytv * Add diftracker.i2p to I2PSnark diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 285b64c36..0cd02d33d 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -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 = 28; + public final static long BUILD = 29; /** for example "-test" */ public final static String EXTRA = "-rc"; diff --git a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java index eec406c31..1c5441f02 100644 --- a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java +++ b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java @@ -60,7 +60,7 @@ public class Reseeder { "http://reseed.i2p-projekt.de/" + "," + "http://forum.i2p2.de/netdb/" + "," + /* "http://www.i2pbote.net/netDb/," + NO DATA */ - /* "http://r31453.ovh.net/static_media/files/netDb/," + DOWN */ + "http://r31453.ovh.net/static_media/files/netDb/" + "," + "http://cowpuncher.drollette.com/netdb/" + "," + "http://75.145.125.59/netDb/"; @@ -70,8 +70,8 @@ public class Reseeder { "https://forum.i2p2.de/netdb/" + "," + /* "https://www.i2pbote.net/netDb/," + NO DATA */ "https://reseed.i2p-projekt.de/" + "," + - /* "https://r31453.ovh.net/static_media/files/netDb/," + DOWN */ - "https://cowpuncher.drollette.com/netdb/" + ";" + + "https://r31453.ovh.net/static_media/files/netDb/" + "," + + "https://cowpuncher.drollette.com/netdb/" + "," + "https://75.145.125.59/netDb/"; private static final String PROP_INPROGRESS = "net.i2p.router.web.ReseedHandler.reseedInProgress"; diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java index 83ce4712a..463a0c682 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java +++ b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java @@ -492,18 +492,25 @@ class BuildHandler { * approaching our connection limit (i.e. !haveCapacity()), * reject this request. * - * Don't do this for class O, under the assumption that they are already talking + * Don't do this for class N or O, under the assumption that they are already talking * to most of the routers, so there's no reason to reject. This may drive them * to their conn. limits, but it's hopefully a temporary solution to the * tunnel build congestion. As the net grows this will have to be revisited. */ RouterInfo ri = _context.router().getRouterInfo(); - if (response == 0 && - (ri == null || ri.getBandwidthTier().charAt(0) != 'O') && - ((isInGW && ! _context.commSystem().haveInboundCapacity(87)) || - (isOutEnd && ! _context.commSystem().haveOutboundCapacity(87)))) { - _context.throttle().setTunnelStatus(_x("Rejecting tunnels: Connection limit")); + if (response == 0) { + if (ri == null) { + // ?? We should always have a RI response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH; + } else { + char bw = ri.getBandwidthTier().charAt(0); + if (bw != 'O' && bw != 'N' && + ((isInGW && ! _context.commSystem().haveInboundCapacity(87)) || + (isOutEnd && ! _context.commSystem().haveOutboundCapacity(87)))) { + _context.throttle().setTunnelStatus(_x("Rejecting tunnels: Connection limit")); + response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH; + } + } } // Check participating throttle counters for previous and next hops diff --git a/router/java/src/net/i2p/router/tunnel/pool/ExploratoryPeerSelector.java b/router/java/src/net/i2p/router/tunnel/pool/ExploratoryPeerSelector.java index d348e52ed..47c4d2b0c 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/ExploratoryPeerSelector.java +++ b/router/java/src/net/i2p/router/tunnel/pool/ExploratoryPeerSelector.java @@ -67,7 +67,7 @@ class ExploratoryPeerSelector extends TunnelPeerSelector { return rv; } - private static final int MIN_NONFAILING_PCT = 25; + private static final int MIN_NONFAILING_PCT = 15; private static final int MIN_ACTIVE_PEERS_STARTUP = 6; private static final int MIN_ACTIVE_PEERS = 12; @@ -141,7 +141,8 @@ class ExploratoryPeerSelector extends TunnelPeerSelector { // l.debug("Client, Expl. Fail pct: " + c + ", " + e); if (e <= c || e <= 25) // doing very well (unlikely) return 0; - if (c >= 90) // doing very badly + // Doing very badly? This is important to prevent network congestion collapse + if (c >= 70 || e >= 75) return 100 - MIN_NONFAILING_PCT; return (100 * (e-c)) / (100-c); }