* Clock:
- Don't let a client update the router clock - Restore and enhance vanished clock error log message
This commit is contained in:
@ -27,7 +27,11 @@ class SetDateMessageHandler extends HandlerImpl {
|
||||
public void handleMessage(I2CPMessage message, I2PSessionImpl session) {
|
||||
_log.debug("Handle message " + message);
|
||||
SetDateMessage msg = (SetDateMessage) message;
|
||||
Clock.getInstance().setNow(msg.getDate().getTime());
|
||||
// Only do this if we are NOT in the router context;
|
||||
// otherwise, it sets getUpdatedSuccessfully() in Clock when all
|
||||
// we did was get the time from ourselves.
|
||||
if (!_context.isRouterContext())
|
||||
Clock.getInstance().setNow(msg.getDate().getTime());
|
||||
session.dateUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,8 +155,13 @@ public class Timestamper implements Runnable {
|
||||
try {
|
||||
lastFailed = !queryTime(_servers.toArray(new String[_servers.size()]));
|
||||
} catch (IllegalArgumentException iae) {
|
||||
if ( (!lastFailed) && (_log.shouldLog(Log.ERROR)) )
|
||||
_log.error("Unable to reach any of the NTP servers - network disconnected?");
|
||||
if ( (!_initialized) && (_log.shouldLog(Log.ERROR)) ) {
|
||||
List<String> all = new ArrayList();
|
||||
if (_priorityServers != null)
|
||||
all.addAll(_priorityServers);
|
||||
all.addAll(_servers);
|
||||
_log.error("Unable to reach any of the NTP servers " + all + " - network disconnected? Or set time.sntpServerList=myserver1.com,myserver2.com in advanced configuration.");
|
||||
}
|
||||
lastFailed = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user