2005-07-11 jrandom

* Reduced the growth factor on the slow start and congestion avoidance for
      the streaming lib.
    * Adjusted some of the I2PTunnelServer threading to use a small pool of
      handlers, rather than launching off new threads which then immediately
      launch off an I2PTunnelRunner instance (which launches 3 more threads..)
    * Don't persist session keys / session tags (not worth it, for now)
    * Added some detection and handling code for duplicate session tags being
      delivered (root cause still not addressed)
    * Make the PRNG's buffer size configurable (via the config property
      "i2p.prng.totalBufferSizeKB=4096")
    * Disable SSU flooding by default (duh)
    * Updates to the StreamSink apps for better throttling tests.
This commit is contained in:
jrandom
2005-07-11 23:06:23 +00:00
committed by zzz
parent 51c492b842
commit 9d5f16a889
21 changed files with 317 additions and 146 deletions

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.198 $ $Date: 2005/07/04 15:44:21 $";
public final static String ID = "$Revision: 1.199 $ $Date: 2005/07/05 17:08:59 $";
public final static String VERSION = "0.5.0.7";
public final static long BUILD = 10;
public final static long BUILD = 11;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -70,6 +70,8 @@ public class SessionKeyPersistenceHelper implements Service {
}
private void writeState() {
if (true) return;
Object o = _context.sessionKeyManager();
if (!(o instanceof PersistentSessionKeyManager)) {
_log.error("Unable to persist the session key state - manager is " + o.getClass().getName());

View File

@ -135,7 +135,7 @@ public class ClientConnectionRunner {
_alreadyProcessed.clear();
}
_config = null;
_manager = null;
//_manager = null;
}
/** current client's config */
@ -271,11 +271,13 @@ public class ClientConnectionRunner {
+ "]");
long beforeDistribute = _context.clock().now();
// the following blocks as described above
_manager.distributeMessage(_config.getDestination(), message.getDestination(), message.getPayload(), id);
SessionConfig cfg = _config;
if (cfg != null)
_manager.distributeMessage(cfg.getDestination(), dest, payload, id);
long timeToDistribute = _context.clock().now() - beforeDistribute;
if (_log.shouldLog(Log.DEBUG))
_log.warn("Time to distribute in the manager to "
+ message.getDestination().calculateHash().toBase64() + ": "
+ dest.calculateHash().toBase64() + ": "
+ timeToDistribute);
return id;
}

View File

@ -103,11 +103,11 @@ public class GarlicMessageReceiver {
clove.getExpiration().getTime());
if (invalidReason != null) {
String howLongAgo = DataHelper.formatDuration(_context.clock().now()-clove.getExpiration().getTime());
if (_log.shouldLog(Log.ERROR))
_log.error("Clove is NOT valid: id=" + clove.getCloveId()
+ " expiration " + howLongAgo + " ago: " + invalidReason + ": " + clove);
if (_log.shouldLog(Log.WARN))
_log.warn("Clove is NOT valid: id=" + clove.getCloveId()
+ " expiration " + howLongAgo + " ago: " + invalidReason + ": " + clove);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Clove is NOT valid: id=" + clove.getCloveId()
+ " expiration " + howLongAgo + " ago", new Exception("Invalid within..."));
_context.messageHistory().messageProcessingError(clove.getCloveId(),
clove.getData().getClass().getName(),

View File

@ -140,7 +140,8 @@ public class TransportManager implements TransportEventListener {
for (int i = 0; i < _transports.size(); i++) {
Transport t = (Transport)_transports.get(i);
if (failedTransports.contains(t.getStyle())) {
_log.debug("Skipping transport " + t.getStyle() + " as it already failed");
if (_log.shouldLog(Log.DEBUG))
_log.debug("Skipping transport " + t.getStyle() + " as it already failed");
continue;
}
// we always want to try all transports, in case there is a faster bidirectional one

View File

@ -114,9 +114,9 @@ class UDPFlooder implements Runnable {
private long calcFloodDelay() {
try {
return Long.parseLong(_context.getProperty("udp.floodDelay", "30000"));
return Long.parseLong(_context.getProperty("udp.floodDelay", "300000"));
} catch (Exception e) {
return 30*1000;
return 5*60*1000;
}
}
}

View File

@ -100,7 +100,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
private static final int PRIORITY_WEIGHT[] = new int[] { 1, 1, 1, 1, 1, 2 };
/** should we flood all UDP peers with the configured rate? */
private static final boolean SHOULD_FLOOD_PEERS = true;
private static final boolean SHOULD_FLOOD_PEERS = false;
private static final int MAX_CONSECUTIVE_FAILED = 5;