* Console: Display "accepting tunnels" instead of "rejecting tunnels" after 20 minutes (ticket #902)

This commit is contained in:
zzz
2013-08-30 12:07:42 +00:00
parent 8655988c66
commit 6ca797ec1f
3 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2013-08-30 zzz 2013-08-30 zzz
* Addresses: Treat Teredo addresses 2001:0::/32 as local * Addresses: Treat Teredo addresses 2001:0::/32 as local
* Console: Display "accepting tunnels" instead of "rejecting tunnels"
after 20 minutes (ticket #902)
* NTCP: Handle race where peer's NTCP address goes away
* SSU, confignet: Add support for specifiying multiple addresses * SSU, confignet: Add support for specifiying multiple addresses
* SusiDNS: Don't require last subscription to be terminated by newline (ticket #1000) * SusiDNS: Don't require last subscription to be terminated by newline (ticket #1000)

View File

@ -1,6 +1,7 @@
package net.i2p.router; package net.i2p.router;
import net.i2p.data.Hash; import net.i2p.data.Hash;
import net.i2p.data.RouterInfo;
import net.i2p.router.peermanager.TunnelHistory; import net.i2p.router.peermanager.TunnelHistory;
import net.i2p.stat.Rate; import net.i2p.stat.Rate;
import net.i2p.stat.RateAverages; import net.i2p.stat.RateAverages;
@ -16,7 +17,7 @@ import net.i2p.util.SimpleTimer;
class RouterThrottleImpl implements RouterThrottle { class RouterThrottleImpl implements RouterThrottle {
protected final RouterContext _context; protected final RouterContext _context;
private final Log _log; private final Log _log;
private String _tunnelStatus; private volatile String _tunnelStatus;
/** /**
* arbitrary hard limit - if it's taking this long to get * arbitrary hard limit - if it's taking this long to get
@ -503,7 +504,16 @@ class RouterThrottleImpl implements RouterThrottle {
/** @since 0.8.12 */ /** @since 0.8.12 */
public void cancelShutdownStatus() { public void cancelShutdownStatus() {
setTunnelStatus(_x("Rejecting tunnels")); // try hard to guess the state, before we actually get a request
int maxTunnels = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
RouterInfo ri = _context.router().getRouterInfo();
if (maxTunnels > 0 &&
!_context.router().isHidden() &&
ri != null && !ri.getBandwidthTier().equals("K")) {
setTunnelStatus(_x("Accepting tunnels"));
} else {
setTunnelStatus(_x("Rejecting tunnels"));
}
} }
public void setTunnelStatus(String msg) { public void setTunnelStatus(String msg) {

View File

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