2005-12-27 jrandom

* Add a new Status: line on the router console - "ERR-ClockSkew", in case
      the clock is too skewed to do anything useful (check the year and month,
      not just the hour and minute).
    * Fixed the read/write timeouts in the streaming lib (so that it actually
      honors them now)
    * Minor I2PSnark cleanups (no read timeout, more careful shutdown and
      torrent closing)
    * Handle an oddball tunnel creation failure (thanks Xunk)
This commit is contained in:
jrandom
2005-12-27 13:20:50 +00:00
committed by zzz
parent 9b7e5d1817
commit 1d0d0d9c69
11 changed files with 63 additions and 22 deletions

View File

@ -82,7 +82,11 @@ public class Clock implements Timestamper.UpdateListener {
}
}
if (_alreadyChanged) {
getLog().log(Log.CRIT, "Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
if (delta > 15*1000)
getLog().log(Log.CRIT, "Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
else if (getLog().shouldLog(Log.INFO))
getLog().info("Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
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;
@ -98,6 +102,8 @@ public class Clock implements Timestamper.UpdateListener {
public long getOffset() {
return _offset;
}
public boolean getUpdatedSuccessfully() { return _alreadyChanged; }
public void setNow(long realTime) {
long diff = realTime - System.currentTimeMillis();