2004-12-20 jrandom

* No longer do a blocking DNS lookup within the jobqueue (thanks mule!)
    * Set a 60s dns cache TTL, instead of 0s.  Most users who used to use
      dyndns/etc now just use IP autodetection, so the old "we need ttl=0"
      reasoning is gone.
This commit is contained in:
jrandom
2004-12-20 05:14:56 +00:00
committed by zzz
parent 1d31831e7d
commit 6cb316b33e
5 changed files with 25 additions and 8 deletions

View File

@ -1,4 +1,10 @@
$Id: history.txt,v 1.114 2004/12/19 11:27:10 jrandom Exp $
$Id: history.txt,v 1.115 2004/12/19 13:55:09 jrandom Exp $
2004-12-20 jrandom
* No longer do a blocking DNS lookup within the jobqueue (thanks mule!)
* Set a 60s dns cache TTL, instead of 0s. Most users who used to use
dyndns/etc now just use IP autodetection, so the old "we need ttl=0"
reasoning is gone.
2004-12-19 jrandom
* Fix for a race on startup wrt the new stats (thanks susi!)

View File

@ -75,9 +75,13 @@ public class Router {
public final static String PROP_SHUTDOWN_IN_PROGRESS = "__shutdownInProgress";
static {
// grumble about sun's java caching DNS entries *forever*
System.setProperty("sun.net.inetaddr.ttl", "0");
System.setProperty("networkaddress.cache.ttl", "0");
// grumble about sun's java caching DNS entries *forever* by default
// so lets just keep 'em for a minute
System.setProperty("sun.net.inetaddr.ttl", "60");
System.setProperty("networkaddress.cache.ttl", "60");
// until we handle restricted routes and/or all peers support v6, try v4 first
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("http.agent", "I2P");
// (no need for keepalive)
System.setProperty("http.keepAlive", "false");
System.setProperty("user.timezone", "GMT");

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.119 $ $Date: 2004/12/19 11:27:10 $";
public final static String ID = "$Revision: 1.120 $ $Date: 2004/12/19 13:55:09 $";
public final static String VERSION = "0.4.2.4";
public final static long BUILD = 4;
public final static long BUILD = 5;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -170,4 +170,12 @@ public class TCPAddress {
}
return false;
}
public boolean equals(RouterAddress addr) {
if (addr == null) return false;
Properties opts = addr.getOptions();
if (opts == null) return false;
return ( (_host.equals(opts.getProperty(PROP_HOST))) &&
(Integer.toString(_port).equals(opts.getProperty(PROP_PORT))) );
}
}

View File

@ -132,8 +132,7 @@ public class TCPTransport extends TransportImpl {
if (addr == null)
return null;
TCPAddress tcpAddr = new TCPAddress(addr);
if ( (_myAddress != null) && (tcpAddr.equals(_myAddress)) )
if ( (_myAddress != null) && (_myAddress.equals(addr)) )
return null; // dont talk to yourself
TransportBid bid = new TransportBid();