This commit is contained in:
zzz
2011-09-28 17:05:38 +00:00
parent 7bac7aaaf3
commit 273e940fa1
17 changed files with 49 additions and 38 deletions

View File

@@ -33,6 +33,7 @@ import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import net.i2p.util.RandomSource;
/**
* This class represents a NTP message, as specified in RFC 2030. The message
@@ -399,7 +400,7 @@ public class NtpMessage {
// low order bits of the timestamp with a random, unbiased
// bitstring, both to avoid systematic roundoff errors and as
// a means of loop detection and replay detection.
array[7+pointer] = (byte) (Math.random()*255.0);
array[7+pointer] = (byte) (RandomSource.getInstance().nextInt());
}

View File

@@ -321,14 +321,16 @@ public class Timestamper implements Runnable {
_context.getProperty(PROP_CONCURRING_SERVERS, DEFAULT_CONCURRING_SERVERS)));
}
/****
public static void main(String args[]) {
System.setProperty(PROP_DISABLED, "false");
System.setProperty(PROP_QUERY_FREQUENCY, "30000");
I2PAppContext ctx = I2PAppContext.getGlobalContext();
I2PAppContext.getGlobalContext();
for (int i = 0; i < 5*60*1000; i += 61*1000) {
try { Thread.sleep(61*1000); } catch (InterruptedException ie) {}
}
}
****/
/**
* Interface to receive update notifications for when we query the time