2004-10-02 jrandom

* Assure that we quickly fail messages bound for shitlisted peers.
    * Address a race on startup where the first peer contacted could hang the
      router (thanks Romster!)
    * Only whine about an intermittent inability to query the time server once
This commit is contained in:
jrandom
2004-10-02 19:05:24 +00:00
committed by zzz
parent ce186e1872
commit d20d043e0f
10 changed files with 43 additions and 45 deletions

View File

@ -115,7 +115,7 @@ public class NtpClient {
//System.out.println("host: " + serverName + " rtt: " + roundTripDelay + " offset: " + localClockOffset + " seconds");
return (long)(System.currentTimeMillis() + localClockOffset*1000);
} catch (IOException ioe) {
ioe.printStackTrace();
//ioe.printStackTrace();
return -1;
}
}

View File

@ -100,6 +100,7 @@ public class Timestamper implements Runnable {
if (_log.shouldLog(Log.INFO))
_log.info("Starting up timestamper");
boolean alreadyBitched = false;
try {
while (true) {
updateConfig();
@ -118,7 +119,9 @@ public class Timestamper implements Runnable {
_log.debug("Stamp time");
stampTime(now);
} catch (IllegalArgumentException iae) {
_log.log(Log.CRIT, "Unable to reach any of the NTP servers - network disconnected?");
if (!alreadyBitched)
_log.log(Log.CRIT, "Unable to reach any of the NTP servers - network disconnected?");
alreadyBitched = true;
}
}
try { Thread.sleep(_queryFrequency); } catch (InterruptedException ie) {}