[freenet-cvs] r18938 - trunk/freenet/src/freenet/support/transport/ip

nextgens at freenetproject.org nextgens at freenetproject.org
Thu Apr 3 07:33:00 UTC 2008


Author: nextgens
Date: 2008-04-03 07:33:00 +0000 (Thu, 03 Apr 2008)
New Revision: 18938

Modified:
   trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
Log:
fix the build, add a FIXME, fix a bug (we weren't setting lastAddressList to null when needed)

Modified: trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
===================================================================
--- trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java	2008-04-03 07:24:19 UTC (rev 18937)
+++ trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java	2008-04-03 07:33:00 UTC (rev 18938)
@@ -40,6 +40,7 @@
 		return System.currentTimeMillis() + interval; // We are pretty cheap
 	}
 
+	InetAddress lastInetAddress = null;
 	InetAddress[] lastAddressList = null;
 	long lastDetectedTime = -1;
 
@@ -116,6 +117,7 @@
 					"Finished scanning interfaces");
 		}
 
+		// FIXME: what are we doing here? lastInetAddress is always null.
 		InetAddress oldAddress = lastInetAddress;
 		onGetAddresses(addrs);
 		lastDetectedTime = System.currentTimeMillis();
@@ -165,7 +167,6 @@
 
 	/** Do something with the list of detected IP addresses.
 	 * @param v Vector of InetAddresses
-	 * @param preferedInetAddress An address that for some reason is prefered above others. Might be null
 	 */
 	protected void onGetAddresses(Vector v) {
 		Vector output = new Vector();
@@ -177,6 +178,7 @@
 		if (v.size() == 0) {
 			Logger.error(this, "No addresses found!");
 			lastAddressList = null;
+			return;
 		} else {
 //			InetAddress lastNonValidAddress = null;
 			for (int x = 0; x < v.size(); x++) {




More information about the cvs mailing list