* 2005-03-18 0.5.0.3 released
2005-03-18 jrandom * Minor tweak to the timestamper to help reduce small skews * Adjust the stats published to include only the relevent ones * Only show the currently used speed calculation on the profile page * Allow the full max # resends to be sent, rather than piggybacking the RESET packet along side the final resend (duh) * Add irc.postman.i2p to the default list of IRC servers for new installs * Drop support for routers running 0.5 or 0.5.0.1 while maintaining backwards compatability for users running 0.5.0.2.
This commit is contained in:
@ -14,8 +14,8 @@ package net.i2p;
|
||||
*
|
||||
*/
|
||||
public class CoreVersion {
|
||||
public final static String ID = "$Revision: 1.29 $ $Date: 2005/02/23 00:00:52 $";
|
||||
public final static String VERSION = "0.5.0.2";
|
||||
public final static String ID = "$Revision: 1.30 $ $Date: 2005/03/06 19:07:28 $";
|
||||
public final static String VERSION = "0.5.0.3";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Core version: " + VERSION);
|
||||
|
@ -52,13 +52,17 @@ class I2CPMessageProducer {
|
||||
CreateSessionMessage msg = new CreateSessionMessage();
|
||||
SessionConfig cfg = new SessionConfig(session.getMyDestination());
|
||||
cfg.setOptions(session.getOptions());
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("config created");
|
||||
try {
|
||||
cfg.signSessionConfig(session.getPrivateKey());
|
||||
} catch (DataFormatException dfe) {
|
||||
throw new I2PSessionException("Unable to sign the session config", dfe);
|
||||
}
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("config signed");
|
||||
msg.setSessionConfig(cfg);
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("config loaded into message");
|
||||
session.sendMessage(msg);
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("config message sent");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -504,12 +504,15 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
||||
|
||||
long beforeSync = _context.clock().now();
|
||||
long inSync = 0;
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("before sync to write");
|
||||
try {
|
||||
synchronized (_out) {
|
||||
inSync = _context.clock().now();
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("before writeMessage");
|
||||
message.writeMessage(_out);
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("after writeMessage");
|
||||
_out.flush();
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("after flush");
|
||||
}
|
||||
} catch (I2CPMessageException ime) {
|
||||
throw new I2PSessionException(getPrefix() + "Error writing out the message", ime);
|
||||
|
@ -73,10 +73,11 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
}
|
||||
public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent)
|
||||
throws I2PSessionException {
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("sending message");
|
||||
if (isClosed()) throw new I2PSessionException("Already closed");
|
||||
if (SHOULD_COMPRESS) payload = DataHelper.compress(payload, offset, size);
|
||||
else throw new IllegalStateException("we need to update sendGuaranteed to support partial send");
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("message compressed");
|
||||
// we always send as guaranteed (so we get the session keys/tags acked),
|
||||
// but only block until the appropriate event has been reached (guaranteed
|
||||
// success or accepted). we may want to break this out into a seperate
|
||||
@ -111,10 +112,12 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
private boolean sendBestEffort(Destination dest, byte payload[], SessionKey keyUsed, Set tagsSent)
|
||||
throws I2PSessionException {
|
||||
long begin = _context.clock().now();
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("begin sendBestEffort");
|
||||
SessionKey key = _context.sessionKeyManager().getCurrentKey(dest.getPublicKey());
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("key fetched");
|
||||
if (key == null) key = _context.sessionKeyManager().createSession(dest.getPublicKey());
|
||||
SessionTag tag = _context.sessionKeyManager().consumeNextAvailableTag(dest.getPublicKey(), key);
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("tag consumed");
|
||||
Set sentTags = null;
|
||||
int oldTags = _context.sessionKeyManager().getAvailableTags(dest.getPublicKey(), key);
|
||||
long availTimeLeft = _context.sessionKeyManager().getAvailableTimeLeft(dest.getPublicKey(), key);
|
||||
@ -151,7 +154,10 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
sentTags.addAll(tagsSent);
|
||||
}
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("before creating nonce");
|
||||
|
||||
long nonce = _context.random().nextInt(Integer.MAX_VALUE);
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("before sync state");
|
||||
MessageState state = new MessageState(nonce, getPrefix());
|
||||
state.setKey(key);
|
||||
state.setTags(sentTags);
|
||||
@ -171,6 +177,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
}
|
||||
}
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("before sync state");
|
||||
long beforeSendingSync = _context.clock().now();
|
||||
long inSendingSync = 0;
|
||||
synchronized (_sendingStates) {
|
||||
|
@ -158,15 +158,12 @@ public class Timestamper implements Runnable {
|
||||
*/
|
||||
private boolean queryTime(String serverList[]) throws IllegalArgumentException {
|
||||
long found[] = new long[_concurringServers];
|
||||
long localTime = -1;
|
||||
long now = -1;
|
||||
long expectedDelta = 0;
|
||||
for (int i = 0; i < _concurringServers; i++) {
|
||||
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
|
||||
localTime = _context.clock().now();
|
||||
now = NtpClient.currentTime(serverList);
|
||||
|
||||
long delta = now - localTime;
|
||||
long delta = now - _context.clock().now();
|
||||
found[i] = delta;
|
||||
if (i == 0) {
|
||||
if (Math.abs(delta) < MAX_VARIANCE) {
|
||||
|
Reference in New Issue
Block a user