2005-01-15 jrandom

* Caught a series of (previously unhandled) errors caused by requeueing
      messages that had timed out on the TCP transport (thanks mae^!)
    * Reduce the barrier to dropping session tags on streaming lib resends -
      every fourth send should drop the tags, forcing ElGamal encryption.  This
      will help speed up the recovery after a disconnect, rather than the drop
      every fifth send.
This commit is contained in:
jrandom
2005-01-15 21:03:14 +00:00
committed by zzz
parent c48875a6fb
commit ecd971c0e5
6 changed files with 55 additions and 37 deletions

View File

@ -831,7 +831,7 @@ public class Connection {
// in case things really suck, the other side may have lost thier
// session tags (e.g. they restarted), so jump back to ElGamal.
int failTagsAt = _options.getMaxResends() - 1;
int failTagsAt = _options.getMaxResends() - 2;
if ( (newWindowSize == 1) && (numSends == failTagsAt) ) {
if (_log.shouldLog(Log.WARN))
_log.warn("Optimistically failing tags at resend " + numSends);

View File

@ -1,4 +1,12 @@
$Id: history.txt,v 1.125 2005/01/05 19:17:53 jrandom Exp $
$Id: history.txt,v 1.126 2005/01/06 15:59:13 jrandom Exp $
2005-01-15 jrandom
* Caught a series of (previously unhandled) errors caused by requeueing
messages that had timed out on the TCP transport (thanks mae^!)
* Reduce the barrier to dropping session tags on streaming lib resends -
every fourth send should drop the tags, forcing ElGamal encryption. This
will help speed up the recovery after a disconnect, rather than the drop
every fifth send.
* 2005-01-06 0.4.2.6 released

View File

@ -41,6 +41,12 @@ public class OutNetMessagePool {
*
*/
public void add(OutNetMessage msg) {
boolean valid = validate(msg);
if (!valid) {
_context.messageRegistry().unregisterPending(msg);
return;
}
if (_log.shouldLog(Log.INFO))
_log.info("Adding outbound message to "
+ msg.getTarget().getIdentity().getHash().toBase64().substring(0,6)
@ -48,11 +54,6 @@ public class OutNetMessagePool {
+ " expiring on " + msg.getMessage().getMessageExpiration()
+ " of type " + msg.getMessageType());
boolean valid = validate(msg);
if (!valid) {
_context.messageRegistry().unregisterPending(msg);
return;
}
MessageSelector selector = msg.getReplySelector();
if (selector != null) {
_context.messageRegistry().registerPending(msg);

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.130 $ $Date: 2005/01/05 19:17:54 $";
public final static String ID = "$Revision: 1.131 $ $Date: 2005/01/06 15:59:13 $";
public final static String VERSION = "0.4.2.6";
public final static long BUILD = 0;
public final static long BUILD = 1;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -164,7 +164,8 @@ public abstract class TransportImpl implements Transport {
_context.statManager().addRateData("transport.expiredOnQueueLifetime", lifetime, lifetime);
if (allowRequeue) {
if ( (msg.getExpiration() <= 0) || (msg.getExpiration() > _context.clock().now()) ) {
if ( ( (msg.getExpiration() <= 0) || (msg.getExpiration() > _context.clock().now()) )
&& (msg.getMessage() != null) ) {
// this may not be the last transport available - keep going
_context.outNetMessagePool().add(msg);
// don't discard the data yet!

View File

@ -23,10 +23,19 @@ public class TCPConnectionEstablisher implements Runnable {
public void run() {
while (true) {
try {
loop();
} catch (Exception e) {
_log.log(Log.CRIT, "wtf, establisher b0rked. send this stack trace to jrandom", e);
}
}
}
private void loop() {
RouterInfo info = _transport.getNextPeer();
if (info == null) {
try { Thread.sleep(5*1000); } catch (InterruptedException ie) {}
continue;
return;
}
ConnectionBuilder cb = new ConnectionBuilder(_context, _transport, info);
@ -55,4 +64,3 @@ public class TCPConnectionEstablisher implements Runnable {
_transport.establishmentComplete(info);
}
}
}