diff --git a/core/java/src/net/i2p/CoreVersion.java b/core/java/src/net/i2p/CoreVersion.java index 2d40ca76bf..a224eb6f54 100644 --- a/core/java/src/net/i2p/CoreVersion.java +++ b/core/java/src/net/i2p/CoreVersion.java @@ -14,8 +14,8 @@ package net.i2p; * */ public class CoreVersion { - public final static String ID = "$Revision: 1.22 $ $Date: 2004/10/01 12:23:00 $"; - public final static String VERSION = "0.4.1.2"; + public final static String ID = "$Revision: 1.23 $ $Date: 2004/10/10 14:33:08 $"; + public final static String VERSION = "0.4.1.3"; public static void main(String args[]) { System.out.println("I2P Core version: " + VERSION); diff --git a/core/java/src/net/i2p/client/I2PSession.java b/core/java/src/net/i2p/client/I2PSession.java index ba52516cd0..9d053ef5d8 100644 --- a/core/java/src/net/i2p/client/I2PSession.java +++ b/core/java/src/net/i2p/client/I2PSession.java @@ -38,6 +38,7 @@ public interface I2PSession { * @return whether it was accepted by the router for delivery or not */ public boolean sendMessage(Destination dest, byte[] payload) throws I2PSessionException; + public boolean sendMessage(Destination dest, byte[] payload, int offset, int size) throws I2PSessionException; /** * Like sendMessage above, except the key used and the tags sent are exposed to the @@ -66,8 +67,8 @@ public interface I2PSession { * the contents of the set is ignored during the call, but afterwards it contains a set of SessionTag * objects that were sent along side the given keyUsed. */ - public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) - throws I2PSessionException; + public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) throws I2PSessionException; + public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent) throws I2PSessionException; /** Receive a message that the router has notified the client about, returning * the payload. diff --git a/core/java/src/net/i2p/client/I2PSessionImpl2.java b/core/java/src/net/i2p/client/I2PSessionImpl2.java index 4d84fcf05f..05c6fe677f 100644 --- a/core/java/src/net/i2p/client/I2PSessionImpl2.java +++ b/core/java/src/net/i2p/client/I2PSessionImpl2.java @@ -62,13 +62,21 @@ class I2PSessionImpl2 extends I2PSessionImpl { } public boolean sendMessage(Destination dest, byte[] payload) throws I2PSessionException { - return sendMessage(dest, payload, new SessionKey(), new HashSet(64)); + return sendMessage(dest, payload, 0, payload.length); + } + public boolean sendMessage(Destination dest, byte[] payload, int offset, int size) throws I2PSessionException { + return sendMessage(dest, payload, offset, size, new SessionKey(), new HashSet(64)); } - public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) + public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) throws I2PSessionException { + return sendMessage(dest, payload, 0, payload.length, keyUsed, tagsSent); + } + public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent) throws I2PSessionException { if (isClosed()) throw new I2PSessionException("Already closed"); - if (SHOULD_COMPRESS) payload = DataHelper.compress(payload); + if (SHOULD_COMPRESS) payload = DataHelper.compress(payload, offset, size); + else throw new IllegalStateException("we need to update sendGuaranteed to support partial send"); + // 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 diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java index de04ae541c..970f3c4e8f 100644 --- a/core/java/src/net/i2p/data/DataHelper.java +++ b/core/java/src/net/i2p/data/DataHelper.java @@ -682,11 +682,14 @@ public class DataHelper { /** compress the data and return a new GZIP compressed array */ public static byte[] compress(byte orig[]) { + return compress(orig, 0, orig.length); + } + public static byte[] compress(byte orig[], int offset, int size) { if ((orig == null) || (orig.length <= 0)) return orig; try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(orig.length); - GZIPOutputStream out = new GZIPOutputStream(baos, orig.length); - out.write(orig); + ByteArrayOutputStream baos = new ByteArrayOutputStream(size); + GZIPOutputStream out = new GZIPOutputStream(baos, size); + out.write(orig, offset, size); out.finish(); out.flush(); byte rv[] = baos.toByteArray(); diff --git a/history.txt b/history.txt index 082fa64597..affbcabf9c 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,10 @@ -$Id: history.txt,v 1.52 2004/10/16 23:00:21 jrandom Exp $ +$Id: history.txt,v 1.53 2004/10/17 16:03:06 jrandom Exp $ + +* 2004-10-18 0.4.1.3 released + +2004-10-18 jrandom + * Allow sending messages with a section of a byte array. + * Reduced stats published. 2004-10-17 jrandom * Don't b0rk on whitespace in the router address. diff --git a/installer/install.xml b/installer/install.xml index 1ef7a1f1c3..df3687a5d8 100644 --- a/installer/install.xml +++ b/installer/install.xml @@ -1 +1 @@ - i2p 0.4.1.1 http://www.i2p.net Base installation files \ No newline at end of file + i2p 0.4.1.3 http://www.i2p.net Base installation files \ No newline at end of file diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 68b51e1460..207af0fb46 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.58 $ $Date: 2004/10/16 22:58:09 $"; - public final static String VERSION = "0.4.1.2"; - public final static long BUILD = 8; + public final static String ID = "$Revision: 1.59 $ $Date: 2004/10/17 16:03:05 $"; + public final static String VERSION = "0.4.1.3"; + public final static long BUILD = 0; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/StatisticsManager.java b/router/java/src/net/i2p/router/StatisticsManager.java index e1ae639305..bf5e67b34e 100644 --- a/router/java/src/net/i2p/router/StatisticsManager.java +++ b/router/java/src/net/i2p/router/StatisticsManager.java @@ -102,30 +102,30 @@ public class StatisticsManager implements Service { stats.putAll(_context.profileManager().summarizePeers(_publishedStats)); includeThroughput(stats); - includeRate("transport.sendProcessingTime", stats, new long[] { 60*1000, 60*60*1000 }); + includeRate("transport.sendProcessingTime", stats, new long[] { 60*60*1000 }); //includeRate("tcp.queueSize", stats); - includeRate("jobQueue.jobLag", stats, new long[] { 60*1000, 60*60*1000 }); - includeRate("jobQueue.jobRun", stats, new long[] { 60*1000, 60*60*1000 }); - includeRate("crypto.elGamal.encrypt", stats, new long[] { 60*1000, 60*60*1000 }); + //includeRate("jobQueue.jobLag", stats, new long[] { 60*1000, 60*60*1000 }); + //includeRate("jobQueue.jobRun", stats, new long[] { 60*1000, 60*60*1000 }); + includeRate("crypto.elGamal.encrypt", stats, new long[] { 60*60*1000 }); //includeRate("crypto.garlic.decryptFail", stats, new long[] { 60*60*1000, 24*60*60*1000 }); - includeRate("tunnel.unknownTunnelTimeLeft", stats, new long[] { 60*60*1000, 24*60*60*1000 }); - includeRate("jobQueue.readyJobs", stats, new long[] { 60*1000, 60*60*1000 }); + includeRate("tunnel.unknownTunnelTimeLeft", stats, new long[] { 60*60*1000 }); + //includeRate("jobQueue.readyJobs", stats, new long[] { 60*60*1000 }); //includeRate("jobQueue.droppedJobs", stats, new long[] { 60*60*1000, 24*60*60*1000 }); - includeRate("inNetPool.dropped", stats, new long[] { 60*60*1000, 24*60*60*1000 }); + //includeRate("inNetPool.dropped", stats, new long[] { 60*60*1000, 24*60*60*1000 }); includeRate("tunnel.participatingTunnels", stats, new long[] { 5*60*1000, 60*60*1000 }); includeRate("tunnel.testSuccessTime", stats, new long[] { 60*60*1000l, 24*60*60*1000l }); //includeRate("tunnel.outboundMessagesProcessed", stats, new long[] { 10*60*1000, 60*60*1000 }); //includeRate("tunnel.inboundMessagesProcessed", stats, new long[] { 10*60*1000, 60*60*1000 }); - includeRate("tunnel.participatingMessagesProcessed", stats, new long[] { 10*60*1000, 60*60*1000 }); - includeRate("tunnel.participatingMessagesProcessedActive", stats, new long[] { 10*60*1000, 60*60*1000 }); + //includeRate("tunnel.participatingMessagesProcessed", stats, new long[] { 10*60*1000, 60*60*1000 }); + //includeRate("tunnel.participatingMessagesProcessedActive", stats, new long[] { 10*60*1000, 60*60*1000 }); //includeRate("tunnel.expiredAfterAcceptTime", stats, new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l }); - includeRate("tunnel.bytesAllocatedAtAccept", stats, new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l }); - includeRate("netDb.lookupsReceived", stats, new long[] { 5*60*1000, 60*60*1000 }); - includeRate("netDb.lookupsHandled", stats, new long[] { 5*60*1000, 60*60*1000 }); - includeRate("netDb.lookupsMatched", stats, new long[] { 5*60*1000, 60*60*1000 }); + includeRate("tunnel.bytesAllocatedAtAccept", stats, new long[] { 60*60*1000l }); + includeRate("netDb.lookupsReceived", stats, new long[] { 60*60*1000 }); + //includeRate("netDb.lookupsHandled", stats, new long[] { 60*60*1000 }); + includeRate("netDb.lookupsMatched", stats, new long[] { 60*60*1000 }); //includeRate("netDb.storeSent", stats, new long[] { 5*60*1000, 60*60*1000 }); includeRate("netDb.successPeers", stats, new long[] { 60*60*1000 }); - includeRate("netDb.failedPeers", stats, new long[] { 60*60*1000 }); + //includeRate("netDb.failedPeers", stats, new long[] { 60*60*1000 }); //includeRate("router.throttleNetDbDoSSend", stats, new long[] { 10*60*1000, 60*60*1000, 24*60*60*1000 }); //includeRate("router.throttleNetDbDoS", stats, new long[] { 10*60*1000, 60*60*1000 }); //includeRate("netDb.searchCount", stats, new long[] { 3*60*60*1000}); @@ -141,11 +141,11 @@ public class StatisticsManager implements Service { //includeRate("transport.receiveMessageSmall", stats, new long[] { 5*60*1000, 60*60*1000 }); //includeRate("transport.receiveMessageMedium", stats, new long[] { 5*60*1000, 60*60*1000 }); //includeRate("transport.receiveMessageLarge", stats, new long[] { 5*60*1000, 60*60*1000 }); - includeRate("client.sendAckTime", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); - includeRate("client.sendsPerFailure", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); - includeRate("client.timeoutCongestionTunnel", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); - includeRate("client.timeoutCongestionMessage", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); - includeRate("client.timeoutCongestionInbound", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); + includeRate("client.sendAckTime", stats, new long[] { 60*60*1000 }, true); + //includeRate("client.sendsPerFailure", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); + //includeRate("client.timeoutCongestionTunnel", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); + //includeRate("client.timeoutCongestionMessage", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); + //includeRate("client.timeoutCongestionInbound", stats, new long[] { 60*60*1000, 24*60*60*1000l }, true); stats.setProperty("stat_uptime", DataHelper.formatDuration(_context.router().getUptime())); stats.setProperty("stat__rateKey", "avg;maxAvg;pctLifetime;[sat;satLim;maxSat;maxSatLim;][num;lifetimeFreq;maxFreq]"); _log.debug("Publishing peer rankings"); @@ -257,12 +257,12 @@ public class StatisticsManager implements Service { String throughputRate = renderThroughput(sendBytes5m, 5*60*1000); stats.setProperty("stat_bandwidthSendBps.5m", throughputRate); - throughputRate = renderThroughput(sendBytes60m, 60*60*1000); - stats.setProperty("stat_bandwidthSendBps.60m", throughputRate); + //throughputRate = renderThroughput(sendBytes60m, 60*60*1000); + //stats.setProperty("stat_bandwidthSendBps.60m", throughputRate); throughputRate = renderThroughput(recvBytes5m, 5*60*1000); stats.setProperty("stat_bandwidthReceiveBps.5m", throughputRate); - throughputRate = renderThroughput(recvBytes60m, 60*60*1000); - stats.setProperty("stat_bandwidthReceiveBps.60m", throughputRate); + //throughputRate = renderThroughput(recvBytes60m, 60*60*1000); + //stats.setProperty("stat_bandwidthReceiveBps.60m", throughputRate); }