forked from I2P_Developers/i2p.i2p
i2ptunnel: Warn about soon-to-expire offline signatures
This commit is contained in:
@ -306,8 +306,14 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
I2PSession session = sockMgr.getSession();
|
||||
if (session.isOffline()) {
|
||||
long exp = session.getOfflineExpiration();
|
||||
if (exp < getTunnel().getContext().clock().now())
|
||||
long remaining = exp - getTunnel().getContext().clock().now();
|
||||
if (remaining <= 0)
|
||||
throw new IllegalArgumentException("Offline signature expired " + DataHelper.formatTime(exp));
|
||||
if (remaining < 60*24*60*60*1000L) {
|
||||
String msg = "Offline signature expires in " + DataHelper.formatDuration(remaining);
|
||||
_log.logAlways(Log.WARN, msg);
|
||||
l.log(msg);
|
||||
}
|
||||
}
|
||||
while (session.isClosed()) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user