diff --git a/apps/addressbook/java/src/addressbook/AddressBook.java b/apps/addressbook/java/src/addressbook/AddressBook.java
index 41a34ee170..93d76ebab8 100644
--- a/apps/addressbook/java/src/addressbook/AddressBook.java
+++ b/apps/addressbook/java/src/addressbook/AddressBook.java
@@ -87,6 +87,7 @@ public class AddressBook {
this.location = subscription.getLocation();
try {
+// EepGet get = new EepGet(I2PAppContext.getGlobalContext(), true, )
URL url = new URL(subscription.getLocation());
HttpURLConnection connection = (HttpURLConnection) url
.openConnection();
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
index 54bde4b264..ced2dd67f7 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
@@ -110,7 +110,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
}
}
if (sockMgr == null) {
- _log.log(Log.CRIT, "Unable to create socket manager");
+ _log.log(Log.CRIT, "Unable to create socket manager (our own? " + ownDest + ")");
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
}
}
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/StreamSinkClient.java b/apps/ministreaming/java/src/net/i2p/client/streaming/StreamSinkClient.java
index 0a8d29cae9..91404a2d31 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/StreamSinkClient.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/StreamSinkClient.java
@@ -84,7 +84,7 @@ public class StreamSinkClient {
Random rand = new Random();
OutputStream out = sock.getOutputStream();
long beforeSending = System.currentTimeMillis();
- for (int i = 0; i < _sendSize; i+= 32) {
+ for (int i = 0; (_sendSize < 0) || (i < _sendSize); i+= 32) {
rand.nextBytes(buf);
out.write(buf);
if (_log.shouldLog(Log.DEBUG))
@@ -117,7 +117,7 @@ public class StreamSinkClient {
/**
* Fire up the client. Usage: StreamSinkClient [i2cpHost i2cpPort] sendSizeKB writeDelayMs serverDestFile
*
+ <%@include file="confignav.jsp" %>
+
+
+
" />
+
+
+
+
+
+ " />
+
+
+
+
+
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
index f0ef8df085..48a90d780a 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
@@ -72,8 +72,8 @@ public class Connection {
private long _lifetimeDupMessageSent;
private long _lifetimeDupMessageReceived;
- public static final long MAX_RESEND_DELAY = 20*1000;
- public static final long MIN_RESEND_DELAY = 10*1000;
+ public static final long MAX_RESEND_DELAY = 10*1000;
+ public static final long MIN_RESEND_DELAY = 3*1000;
/** wait up to 5 minutes after disconnection so we can ack/close packets */
public static int DISCONNECT_TIMEOUT = 5*60*1000;
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java b/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java
index 144a37eb65..671330026f 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java
@@ -38,6 +38,10 @@ public class MessageOutputStream extends OutputStream {
* size
*/
private volatile int _nextBufferSize;
+ // rate calc helpers
+ private long _sendPeriodBeginTime;
+ private long _sendPeriodBytes;
+ private int _sendBps;
public MessageOutputStream(I2PAppContext ctx, DataReceiver receiver) {
this(ctx, receiver, Packet.MAX_PAYLOAD_SIZE);
@@ -55,6 +59,10 @@ public class MessageOutputStream extends OutputStream {
_writeTimeout = -1;
_passiveFlushDelay = 500;
_nextBufferSize = -1;
+ _sendPeriodBeginTime = ctx.clock().now();
+ _sendPeriodBytes = 0;
+ _sendBps = 0;
+ _context.statManager().createRateStat("stream.sendBps", "How fast we pump data through the stream", "Stream", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
_flusher = new Flusher();
if (_log.shouldLog(Log.DEBUG))
_log.debug("MessageOutputStream created");
@@ -137,6 +145,21 @@ public class MessageOutputStream extends OutputStream {
if ( (elapsed > 10*1000) && (_log.shouldLog(Log.DEBUG)) )
_log.debug("wtf, took " + elapsed + "ms to write to the stream?", new Exception("foo"));
throwAnyError();
+ updateBps(len);
+ }
+
+ private void updateBps(int len) {
+ long now = _context.clock().now();
+ int periods = (int)Math.floor((now - _sendPeriodBeginTime) / 1000d);
+ if (periods > 0) {
+ // first term decays on slow transmission
+ _sendBps = (int)(((float)0.9f*((float)_sendBps/(float)periods)) + ((float)0.1f*((float)_sendPeriodBytes/(float)periods)));
+ _sendPeriodBytes = len;
+ _sendPeriodBeginTime = now;
+ _context.statManager().addRateData("stream.sendBps", _sendBps, 0);
+ } else {
+ _sendPeriodBytes += len;
+ }
}
public void write(int b) throws IOException {
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/PacketHandler.java b/apps/streaming/java/src/net/i2p/client/streaming/PacketHandler.java
index 1c53401519..877dd0c476 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/PacketHandler.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/PacketHandler.java
@@ -119,6 +119,19 @@ public class PacketHandler {
}
private void receiveKnownCon(Connection con, Packet packet) {
+ if (packet.isFlagSet(Packet.FLAG_ECHO)) {
+ if (packet.getSendStreamId() != null) {
+ receivePing(packet);
+ } else if (packet.getReceiveStreamId() != null) {
+ receivePong(packet);
+ } else {
+ if (_log.shouldLog(Log.WARN))
+ _log.warn("Echo packet received with no stream IDs: " + packet);
+ }
+ packet.releasePayload();
+ return;
+ }
+
// the packet is pointed at a stream ID we're receiving on
if (isValidMatch(con.getSendStreamId(), packet.getReceiveStreamId())) {
// the packet's receive stream ID also matches what we expect
@@ -163,8 +176,19 @@ public class PacketHandler {
} else {
if (!con.getResetSent()) {
// someone is sending us a packet on the wrong stream
- if (_log.shouldLog(Log.WARN))
- _log.warn("Received a packet on the wrong stream: " + packet + " connection: " + con);
+ if (_log.shouldLog(Log.ERROR)) {
+ Set cons = _manager.listConnections();
+ StringBuffer buf = new StringBuffer(512);
+ buf.append("Received a packet on the wrong stream: ");
+ buf.append(packet);
+ buf.append(" connection: ");
+ buf.append(con);
+ for (Iterator iter = cons.iterator(); iter.hasNext();) {
+ Connection cur = (Connection)iter.next();
+ buf.append(" ").append(cur);
+ }
+ _log.error(buf.toString(), new Exception("Wrong stream"));
+ }
}
packet.releasePayload();
}
diff --git a/apps/susimail/src/src/i2p/susi/webmail/Mail.java b/apps/susimail/src/src/i2p/susi/webmail/Mail.java
index a760c61609..a60f9b93c5 100644
--- a/apps/susimail/src/src/i2p/susi/webmail/Mail.java
+++ b/apps/susimail/src/src/i2p/susi/webmail/Mail.java
@@ -1,239 +1,239 @@
-/*
- * Created on Nov 9, 2004
- *
- * This file is part of susimail project, see http://susi.i2p/
- *
- * Copyright (C) 2004-2005