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

@ -18,6 +18,7 @@
<echo message=" updaterWithJetty: tar the built i2p specific files and jetty into an i2pupdate.zip (extracts safely over existing installs)" /> <echo message=" updaterWithJetty: tar the built i2p specific files and jetty into an i2pupdate.zip (extracts safely over existing installs)" />
<echo message=" updaterWithJettyFixes: updater including local jetty patches" /> <echo message=" updaterWithJettyFixes: updater including local jetty patches" />
<echo message=" updaterWithGeoIP: updater including GeoIP Files" /> <echo message=" updaterWithGeoIP: updater including GeoIP Files" />
<echo message=" updaterWithJettyFixesAndGeoIP" />
<echo message=" updaterSmall: updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" /> <echo message=" updaterSmall: updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
<echo message=" updaterRouter: updater with the i2p.jar and router.jar only" /> <echo message=" updaterRouter: updater with the i2p.jar and router.jar only" />
<echo message=" distclean: clean up all derived files" /> <echo message=" distclean: clean up all derived files" />
@ -201,7 +202,8 @@
<fileset dir="." includes="**/*.java~" /> <fileset dir="." includes="**/*.java~" />
</delete> </delete>
</target> </target>
<target name="pkg" depends="distclean, updaterWithJettyFixes, tarball, installer" /> <!-- one release only, then back to updaterWithJettyFixes -->
<target name="pkg" depends="distclean, updaterWithJettyFixesAndGeoIP, tarball, installer" />
<target name="pkgclean" depends="deletepkg-temp"> <target name="pkgclean" depends="deletepkg-temp">
<delete> <delete>
<fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip" /> <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip" />
@ -321,24 +323,20 @@
<target name="deletepkg-temp"> <target name="deletepkg-temp">
<delete dir="pkg-temp" /> <delete dir="pkg-temp" />
</target> </target>
<target name="prepconsoleDocs"> <target name="prepconsoleDocs" depends="prepgeoupdate">
<copy todir="pkg-temp/docs/" > <copy todir="pkg-temp/docs/" >
<fileset dir="." includes="readme*.html" /> <fileset dir="." includes="readme*.html" />
<fileset dir="installer/resources/" includes="*-header.ht" /> <fileset dir="installer/resources/" includes="*-header.ht" />
</copy> </copy>
<copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy todir="pkg-temp/docs/icons/flags" >
<fileset dir="installer/resources/icons/flags" />
</copy>
</target> </target>
<target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs"> <target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs">
<zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" /> <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
</target> </target>
<target name="updater" depends="prepupdate, preplicenses, zipit" /> <target name="updater" depends="prepupdate, preplicenses, zipit" />
<target name="updaterWithGeoIP" depends="prepgeoupdate, preplicenses, zipit" /> <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
<target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" /> <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
<target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" /> <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
<target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
<target name="updaterSmall" depends="prepupdateSmall, zipit" /> <target name="updaterSmall" depends="prepupdateSmall, zipit" />
<target name="updaterRouter" depends="prepupdateRouter, zipit" /> <target name="updaterRouter" depends="prepupdateRouter, zipit" />
<target name="zipit"> <target name="zipit">
@ -376,7 +374,7 @@
<copy file="build/i2p.jar" todir="pkg-temp/lib/" /> <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
<copy file="build/router.jar" todir="pkg-temp/lib/" /> <copy file="build/router.jar" todir="pkg-temp/lib/" />
</target> </target>
<target name="prepgeoupdate" depends="prepupdate"> <target name="prepgeoupdate">
<copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" /> <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" /> <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy todir="pkg-temp/docs/icons/flags" > <copy todir="pkg-temp/docs/icons/flags" >

View File

@ -2,6 +2,7 @@ package net.i2p.time;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
@ -246,7 +247,12 @@ public class Timestamper implements Runnable {
if ( (serverList == null) || (serverList.trim().length() <= 0) ) { if ( (serverList == null) || (serverList.trim().length() <= 0) ) {
serverList = DEFAULT_SERVER_LIST; serverList = DEFAULT_SERVER_LIST;
String country = _context.getProperty(PROP_IP_COUNTRY); String country = _context.getProperty(PROP_IP_COUNTRY);
if (country != null) { if (country == null) {
country = Locale.getDefault().getCountry();
if (country != null)
country = country.toLowerCase();
}
if (country != null && country.length() > 0) {
_priorityServers = new ArrayList(3); _priorityServers = new ArrayList(3);
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
_priorityServers.add(i + "." + country + ".pool.ntp.org"); _priorityServers.add(i + "." + country + ".pool.ntp.org");

View File

@ -49,8 +49,8 @@ class RouterWatchdog implements Runnable {
} }
private boolean shutdownOnHang() { private boolean shutdownOnHang() {
// prop default true // prop default false
if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang", "true")).booleanValue()) if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang")).booleanValue())
return false; return false;
// Client manager starts complaining after 10 minutes, and we run every minute, // 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(); long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
_log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max)); _log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max));
if (_consecutiveErrors == 1) { 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... // This might work on linux...
// It won't on windows, and we can't call i2prouter.bat either, it does something // It won't on windows, and we can't call i2prouter.bat either, it does something
// completely different... // completely different...

View File

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

View File

@ -106,6 +106,9 @@ public abstract class TransportImpl implements Transport {
! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled()) ! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled())
def = MAX_CONNECTION_FACTOR * (1 + bw - Router.CAPABILITY_BW12); 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); 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. * 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 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; private static final long MAX_EXPIRE_IDLE_TIME = 15*60*1000l;
public EventPumper(RouterContext ctx, NTCPTransport transport) { public EventPumper(RouterContext ctx, NTCPTransport transport) {

View File

@ -458,7 +458,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
else else
out.write("<td>n/a</td>"); out.write("<td>n/a</td>");
if (cfg.getReceiveFrom() != null) if (cfg.getReceiveFrom() != null)
out.write("<td>" + netDbLink(cfg.getReceiveFrom()) +"</td>"); out.write("<td align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
else else
out.write("<td>&nbsp;</td>"); out.write("<td>&nbsp;</td>");
if (cfg.getSendTunnel() != null) if (cfg.getSendTunnel() != null)
@ -466,7 +466,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
else else
out.write("<td>&nbsp;</td>"); out.write("<td>&nbsp;</td>");
if (cfg.getSendTo() != null) if (cfg.getSendTo() != null)
out.write("<td>" + netDbLink(cfg.getSendTo()) +"</td>"); out.write("<td align=\"right\">" + netDbLink(cfg.getSendTo()) +"</td>");
else else
out.write("<td>&nbsp;</td>"); out.write("<td>&nbsp;</td>");
long timeLeft = cfg.getExpiration()-_context.clock().now(); 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("<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"); 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) { for (Hash h : peerList) {
out.write("<tr><td>"); out.write("<tr><td align=\"right\">");
out.write(netDbLink(h)); out.write(netDbLink(h));
out.write("<td align=\"right\">" + lc.count(h)); out.write("<td align=\"right\">" + lc.count(h));
out.write("<td align=\"right\">"); out.write("<td align=\"right\">");

View File

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