I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f1c50b7f authored by zzz's avatar zzz
Browse files

* Clock:

      - Don't let a client update the router clock
      - Restore and enhance vanished clock error log message
parent 959bf4a7
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
}
\ No newline at end of file
}
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment