forked from I2P_Developers/i2p.i2p
2005-02-16 jrandom
* (Merged the 0.5-pre branch back into CVS HEAD)
* Replaced the old tunnel routing crypto with the one specified in
router/doc/tunnel-alt.html, including updates to the web console to view
and tweak it.
* Provide the means for routers to reject tunnel requests with a wider
range of responses:
probabalistic rejection, due to approaching overload
transient rejection, due to temporary overload
bandwidth rejection, due to persistent bandwidth overload
critical rejection, due to general router fault (or imminent shutdown)
The different responses are factored into the profiles accordingly.
* Replaced the old I2CP tunnel related options (tunnels.depthInbound, etc)
with a series of new properties, relevent to the new tunnel routing code:
inbound.nickname (used on the console)
inbound.quantity (# of tunnels to use in any leaseSets)
inbound.backupQuantity (# of tunnels to keep in the ready)
inbound.length (# of remote peers in the tunnel)
inbound.lengthVariance (if > 0, permute the length by adding a random #
up to the variance. if < 0, permute the length
by adding or subtracting a random # up to the
variance)
outbound.* (same as the inbound, except for the, uh, outbound tunnels
in that client's pool)
There are other options, and more will be added later, but the above are
the most relevent ones.
* Replaced Jetty 4.2.21 with Jetty 5.1.2
* Compress all profile data on disk.
* Adjust the reseeding functionality to work even when the JVM's http proxy
is set.
* Enable a poor-man's interactive-flow in the streaming lib by choking the
max window size.
* Reduced the default streaming lib max message size to 16KB (though still
configurable by the user), also doubling the default maximum window
size.
* Replaced the RouterIdentity in a Lease with its SHA256 hash.
* Reduced the overall I2NP message checksum from a full 32 byte SHA256 to
the first byte of the SHA256.
* Added a new "netId" flag to let routers drop references to other routers
who we won't be able to talk to.
* Extended the timestamper to get a second (or third) opinion whenever it
wants to actually adjust the clock offset.
* Replaced that kludge of a timestamp I2NP message with a full blown
DateMessage.
* Substantial memory optimizations within the router and the SDK to reduce
GC churn. Client apps and the streaming libs have not been tuned,
however.
* More bugfixes thank you can shake a stick at.
2005-02-13 jrandom
* Updated jbigi source to handle 64bit CPUs. The bundled jbigi.jar still
only contains 32bit versions, so build your own, placing libjbigi.so in
your install dir if necessary. (thanks mule!)
* Added support for libjbigi-$os-athlon64 to NativeBigInteger and CPUID
(thanks spaetz!)
This commit is contained in:
@@ -18,6 +18,7 @@ public class Clock implements Timestamper.UpdateListener {
|
||||
private I2PAppContext _context;
|
||||
private Timestamper _timestamper;
|
||||
private long _startedOn;
|
||||
private boolean _statCreated;
|
||||
|
||||
public Clock(I2PAppContext context) {
|
||||
_context = context;
|
||||
@@ -26,6 +27,7 @@ public class Clock implements Timestamper.UpdateListener {
|
||||
_listeners = new HashSet(64);
|
||||
_timestamper = new Timestamper(context, this);
|
||||
_startedOn = System.currentTimeMillis();
|
||||
_statCreated = false;
|
||||
}
|
||||
public static Clock getInstance() {
|
||||
return I2PAppContext.getGlobalContext().clock();
|
||||
@@ -78,10 +80,15 @@ public class Clock implements Timestamper.UpdateListener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (_alreadyChanged)
|
||||
if (_alreadyChanged) {
|
||||
getLog().log(Log.CRIT, "Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
|
||||
else
|
||||
if (!_statCreated)
|
||||
_context.statManager().createRateStat("clock.skew", "How far is the already adjusted clock being skewed?", "Clock", new long[] { 10*60*1000, 3*60*60*1000, 24*60*60*60 });
|
||||
_statCreated = true;
|
||||
_context.statManager().addRateData("clock.skew", delta, 0);
|
||||
} else {
|
||||
getLog().log(Log.INFO, "Initializing clock offset to " + offsetMs + "ms from " + _offset + "ms");
|
||||
}
|
||||
_alreadyChanged = true;
|
||||
_offset = offsetMs;
|
||||
fireOffsetChanged(delta);
|
||||
|
||||
@@ -97,6 +97,7 @@ public class NativeBigInteger extends BigInteger {
|
||||
private final static String JBIGI_OPTIMIZATION_K6_2 = "k62";
|
||||
private final static String JBIGI_OPTIMIZATION_K6_3 = "k63";
|
||||
private final static String JBIGI_OPTIMIZATION_ATHLON = "athlon";
|
||||
private final static String JBIGI_OPTIMIZATION_ATHLON64 = "athlon64";
|
||||
private final static String JBIGI_OPTIMIZATION_PENTIUM = "pentium";
|
||||
private final static String JBIGI_OPTIMIZATION_PENTIUMMMX = "pentiummmx";
|
||||
private final static String JBIGI_OPTIMIZATION_PENTIUM2 = "pentium2";
|
||||
@@ -130,6 +131,8 @@ public class NativeBigInteger extends BigInteger {
|
||||
CPUInfo c = CPUID.getInfo();
|
||||
if (c instanceof AMDCPUInfo) {
|
||||
AMDCPUInfo amdcpu = (AMDCPUInfo) c;
|
||||
if (amdcpu.IsAthlon64Compatible())
|
||||
return JBIGI_OPTIMIZATION_ATHLON64;
|
||||
if (amdcpu.IsAthlonCompatible())
|
||||
return JBIGI_OPTIMIZATION_ATHLON;
|
||||
if (amdcpu.IsK6_3_Compatible())
|
||||
|
||||
@@ -49,7 +49,9 @@ public class SimpleTimer {
|
||||
*
|
||||
*/
|
||||
public void addEvent(TimedEvent event, long timeoutMs) {
|
||||
long eventTime = System.currentTimeMillis() + timeoutMs;
|
||||
int totalEvents = 0;
|
||||
long now = System.currentTimeMillis();
|
||||
long eventTime = now + timeoutMs;
|
||||
Long time = new Long(eventTime);
|
||||
synchronized (_events) {
|
||||
// remove the old scheduled position, then reinsert it
|
||||
@@ -72,8 +74,20 @@ public class SimpleTimer {
|
||||
}
|
||||
}
|
||||
|
||||
totalEvents = _events.size();
|
||||
_events.notifyAll();
|
||||
}
|
||||
if (time.longValue() > eventTime + 5) {
|
||||
if (_log.shouldLog(Log.ERROR))
|
||||
_log.error("Lots of timer congestion, had to push " + event + " back "
|
||||
+ (time.longValue()-eventTime) + "ms (# events: " + totalEvents + ")");
|
||||
}
|
||||
long timeToAdd = System.currentTimeMillis() - now;
|
||||
if (timeToAdd > 50) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("timer contention: took " + timeToAdd + "ms to add a job");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean removeEvent(TimedEvent evt) {
|
||||
|
||||
Reference in New Issue
Block a user