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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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) {}
|
||||
|
Reference in New Issue
Block a user