2005-09-25 Complication
* Better i2paddresshelper handling in the I2PTunnel httpclient, plus a new conflict resolution page if the i2paddresshelper parameter differs from an existing name to destination mapping. 2005-09-25 jrandom * Fix a long standing streaming lib bug (in the inactivity detection code) * Improved handling of initial streaming lib packet retransmissions to kill the "lost first packet" bug (where a page shows up with the first few KB missing) * Add support for initial window sizes greater than 1 - useful for eepsites to transmit e.g. 4 packets full of data along with the initial ACK, thereby cutting down on the rtt latency. The congestion window size can and does still shrink down to 1 packet though. * Adjusted the streaming lib retransmission calculation algorithm to be more TCP-like.
This commit is contained in:
@ -414,7 +414,12 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
||||
if ( (msgId != null) && (size != null) ) {
|
||||
if (_sessionListener != null) {
|
||||
try {
|
||||
long before = System.currentTimeMillis();
|
||||
_sessionListener.messageAvailable(I2PSessionImpl.this, msgId.intValue(), size.intValue());
|
||||
long duration = System.currentTimeMillis() - before;
|
||||
if ((duration > 100) && _log.shouldLog(Log.ERROR))
|
||||
_log.error("Message availability notification for " + msgId.intValue() + " took "
|
||||
+ duration + " to " + _sessionListener);
|
||||
} catch (Exception e) {
|
||||
_log.log(Log.CRIT, "Error notifying app of message availability", e);
|
||||
}
|
||||
|
@ -93,8 +93,10 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
*/
|
||||
public byte[] receiveMessage(int msgId) throws I2PSessionException {
|
||||
byte compressed[] = super.receiveMessage(msgId);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("receiving message " + msgId + " with " + compressed.length + " compressed bytes");
|
||||
if (compressed == null) {
|
||||
_log.error("Error: message " + msgId + " already received!");
|
||||
return null;
|
||||
}
|
||||
if (SHOULD_COMPRESS) {
|
||||
try {
|
||||
return DataHelper.decompress(compressed);
|
||||
|
@ -37,7 +37,7 @@ public class ByteArray implements Serializable, Comparable {
|
||||
_valid = length;
|
||||
}
|
||||
|
||||
public final byte[] getData() {
|
||||
public byte[] getData() {
|
||||
return _data;
|
||||
}
|
||||
|
||||
@ -50,10 +50,10 @@ public class ByteArray implements Serializable, Comparable {
|
||||
* this property does not necessarily have meaning for all byte
|
||||
* arrays.
|
||||
*/
|
||||
public final int getValid() { return _valid; }
|
||||
public final void setValid(int valid) { _valid = valid; }
|
||||
public final int getOffset() { return _offset; }
|
||||
public final void setOffset(int offset) { _offset = offset; }
|
||||
public int getValid() { return _valid; }
|
||||
public void setValid(int valid) { _valid = valid; }
|
||||
public int getOffset() { return _offset; }
|
||||
public void setOffset(int offset) { _offset = offset; }
|
||||
|
||||
public final boolean equals(Object o) {
|
||||
if (o == null) return false;
|
||||
@ -83,7 +83,7 @@ public class ByteArray implements Serializable, Comparable {
|
||||
return DataHelper.hashCode(getData());
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
public String toString() {
|
||||
return super.toString() + "/" + DataHelper.toString(getData(), 32) + "." + _valid;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user