(mmMMmm profiling)

2004-10-30  jrandom
    * Cache the temporary objects used in the AES encryption/decryption
      process so that AES doesn't require any memory allocation to process
      data.
    * Dramatically reduce memory usage within various crypto implementations
      by avoiding unnecessary (though simplifying) buffers.
    * If we specify some tags to be sent in an I2CP message explicitly, use
      only those, not those plus a new set (otherwise we aren't sure on ACK
      which set was delivered)
    * Allow configuration for the partial send timeout (how long before
      resending a message down a different tunnel in a lease).  This can be
      updated with the "router.clientPartialSendTimeout" router config prop.
    * Logging
This commit is contained in:
jrandom
2004-10-30 23:43:59 +00:00
committed by zzz
parent b571f331ec
commit 58fcbad20a
20 changed files with 530 additions and 284 deletions

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.63 $ $Date: 2004/10/27 21:11:52 $";
public final static String ID = "$Revision: 1.64 $ $Date: 2004/10/29 21:40:52 $";
public final static String VERSION = "0.4.1.3";
public final static long BUILD = 4;
public final static long BUILD = 5;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -36,7 +36,7 @@ import net.i2p.util.Log;
/**
* Send a client message, taking into consideration the fact that there may be
* multiple inbound tunnels that the target provides. This job sends it to one
* of them and if it doesnt get a confirmation within 15 seconds (SEND_TIMEOUT_MS),
* of them and if it doesnt get a confirmation within a few seconds (getSendTimeout()),
* it tries the next, continuing on until a confirmation is received, the full
* timeout has been reached (60 seconds, or the ms defined in the client's or
* router's "clientMessageTimeout" option).
@ -63,7 +63,9 @@ public class OutboundClientMessageJob extends JobImpl {
private final static long OVERALL_TIMEOUT_MS_DEFAULT = 60*1000;
/** how long for each send do we allow before going on to the next? */
private final static long SEND_TIMEOUT_MS = 10*1000;
private final static long DEFAULT_SEND_PARTIAL_TIMEOUT = 10*1000;
private static final String PROP_SEND_PARTIAL_TIMEOUT = "router.clientPartialSendTimeout";
/** priority of messages, that might get honored some day... */
private final static int SEND_PRIORITY = 500;
@ -132,6 +134,15 @@ public class OutboundClientMessageJob extends JobImpl {
_shouldBundle = getShouldBundle();
}
private long getSendTimeout() {
String timeout = getContext().getProperty(PROP_SEND_PARTIAL_TIMEOUT, ""+DEFAULT_SEND_PARTIAL_TIMEOUT);
try {
return Long.parseLong(timeout);
} catch (NumberFormatException nfe) {
return DEFAULT_SEND_PARTIAL_TIMEOUT;
}
}
public String getName() { return "Outbound client message"; }
public void runJob() {
@ -375,7 +386,7 @@ public class OutboundClientMessageJob extends JobImpl {
SendTunnelMessageJob j = new SendTunnelMessageJob(getContext(), msg, outTunnelId,
lease.getRouterIdentity().getHash(),
lease.getTunnelId(), null, onReply,
onFail, selector, SEND_TIMEOUT_MS,
onFail, selector, getSendTimeout(),
SEND_PRIORITY);
getContext().jobQueue().addJob(j);
} else {