propagate from branch 'i2p.i2p.zzz.test' (head f92f40cceea44a063e48db07d10fd8cf7df3e348)

to branch 'i2p.i2p' (head c497aec52c49d2e03430b88d8d73148ee73e59a5)
This commit is contained in:
zzz
2009-06-07 14:45:33 +00:00
8 changed files with 28 additions and 20 deletions

View File

@ -49,8 +49,8 @@ class RouterWatchdog implements Runnable {
}
private boolean shutdownOnHang() {
// prop default true
if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang", "true")).booleanValue())
// prop default false
if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang")).booleanValue())
return false;
// Client manager starts complaining after 10 minutes, and we run every minute,
@ -94,7 +94,7 @@ class RouterWatchdog implements Runnable {
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
_log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max));
if (_consecutiveErrors == 1) {
_log.log(Log.CRIT, "Router appears hung! Will restart in 20 minutes if it doesn't fix itself");
_log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!");
// This might work on linux...
// It won't on windows, and we can't call i2prouter.bat either, it does something
// completely different...

View File

@ -1069,8 +1069,8 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
buf.append("Address(es): <i>");
String country = _context.commSystem().getCountry(info.getIdentity().getHash());
if(country != null) {
buf.append(" <img alt=\"").append(country.toUpperCase()).append("\"");
buf.append(" src=\"/flags.jsp?c=").append(country).append("\">");
buf.append("<img alt=\"").append(country.toUpperCase()).append("\"");
buf.append(" src=\"/flags.jsp?c=").append(country).append("\"> ");
}
for (Iterator iter = info.getAddresses().iterator(); iter.hasNext(); ) {
RouterAddress addr = (RouterAddress)iter.next();

View File

@ -106,6 +106,9 @@ public abstract class TransportImpl implements Transport {
! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled())
def = MAX_CONNECTION_FACTOR * (1 + bw - Router.CAPABILITY_BW12);
}
// increase limit for SSU, for now
if (style.equals("udp"))
def = def * 4 / 3;
return _context.getProperty("i2np." + style + ".maxConnections", def);
}

View File

@ -51,7 +51,8 @@ public class EventPumper implements Runnable {
* the time to iterate across them to check a few flags shouldn't be a problem.
*/
private static final long FAILSAFE_ITERATION_FREQ = 2*1000l;
private static final long MIN_EXPIRE_IDLE_TIME = 5*60*1000l;
/** tunnel test is every 30-60s, so this should be longer than, say, 3*45s to allow for drops */
private static final long MIN_EXPIRE_IDLE_TIME = 3*60*1000l;
private static final long MAX_EXPIRE_IDLE_TIME = 15*60*1000l;
public EventPumper(RouterContext ctx, NTCPTransport transport) {

View File

@ -458,7 +458,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
else
out.write("<td>n/a</td>");
if (cfg.getReceiveFrom() != null)
out.write("<td>" + netDbLink(cfg.getReceiveFrom()) +"</td>");
out.write("<td align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
else
out.write("<td>&nbsp;</td>");
if (cfg.getSendTunnel() != null)
@ -466,7 +466,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
else
out.write("<td>&nbsp;</td>");
if (cfg.getSendTo() != null)
out.write("<td>" + netDbLink(cfg.getSendTo()) +"</td>");
out.write("<td align=\"right\">" + netDbLink(cfg.getSendTo()) +"</td>");
else
out.write("<td>&nbsp;</td>");
long timeLeft = cfg.getExpiration()-_context.clock().now();
@ -603,7 +603,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.write("<h2><a name=\"peers\">Tunnel Counts By Peer</a>:</h2>\n");
out.write("<table border=\"1\"><tr><td><b>Peer</b></td><td><b>Expl. + Client</b></td><td><b>% of total</b></td><td><b>Part. from + to</b></td><td><b>% of total</b></td></tr>\n");
for (Hash h : peerList) {
out.write("<tr><td>");
out.write("<tr><td align=\"right\">");
out.write(netDbLink(h));
out.write("<td align=\"right\">" + lc.count(h));
out.write("<td align=\"right\">");

View File

@ -104,7 +104,7 @@ public abstract class Parser
public Node parse(String descr) throws ParserException
{
try {
StringBufferInputStream decrIn = new StringBufferInputStream(descr);
InputStream decrIn = new ByteArrayInputStream(descr.getBytes());
Node root = parse(decrIn);
return root;
} catch (Exception e) {