propagate from branch 'i2p.i2p.zzz.test' (head 5474e1a513fc8144a3d855e9c85d8b235f7f9816)

to branch 'i2p.i2p' (head 5932d3923108572b22a8a7a600f0f9e62ecac347)
This commit is contained in:
zzz
2012-07-30 22:29:02 +00:00
305 changed files with 54690 additions and 44647 deletions

View File

@@ -255,7 +255,8 @@ public class Router implements RouterClock.ClockShiftListener {
// ********* Start no threads before here ********* //
//
// NOW we can start the ping file thread.
beginMarkingLiveliness();
if (!System.getProperty("java.vendor").contains("Android"))
beginMarkingLiveliness();
// Apps may use this as an easy way to determine if they are in the router JVM
// But context.isRouterContext() is even easier...

View File

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

View File

@@ -6,22 +6,28 @@ import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
/**
* Help sort Hashes in relation to a base key using the XOR metric
*
* Help sort Hashes in relation to a base key using the XOR metric.
* Warning - not thread safe.
*/
class XORComparator implements Comparator<Hash> {
private final byte[] _base;
private final byte[] _lx, _rx;
/**
* @param target key to compare distances with
*/
public XORComparator(Hash target) {
_base = target.getData();
_lx = new byte[Hash.HASH_LENGTH];
_rx = new byte[Hash.HASH_LENGTH];
}
/**
* getData() of args must be non-null
*/
public int compare(Hash lhs, Hash rhs) {
byte lhsDelta[] = DataHelper.xor(lhs.getData(), _base);
byte rhsDelta[] = DataHelper.xor(rhs.getData(), _base);
return DataHelper.compareTo(lhsDelta, rhsDelta);
DataHelper.xor(lhs.getData(), 0, _base, 0, _lx, 0, Hash.HASH_LENGTH);
DataHelper.xor(rhs.getData(), 0, _base, 0, _rx, 0, Hash.HASH_LENGTH);
return DataHelper.compareTo(_lx, _rx);
}
}

View File

@@ -138,7 +138,8 @@ class OutboundMessageState {
if (_messageBuf != null && !_released) {
_cache.release(_messageBuf);
_released = true;
_releasedBy = new Exception ("Released on " + new Date() + " by:");
if (_log.shouldLog(Log.WARN))
_releasedBy = new Exception ("Released on " + new Date() + " by:");
}
//_messageBuf = null;
}