2005-10-13 jrandom

* SSU retransmission choke bugfix (== != !=)
    * Include initial transmissions in the retransmission choke, so that
      if we are already retransmitting a message, we won't send anything
      to that peer other than that message (or ACKs, if necessary)
This commit is contained in:
jrandom
2005-10-13 09:18:35 +00:00
committed by zzz
parent 3516701272
commit 00a4761b5e
3 changed files with 19 additions and 14 deletions

View File

@ -1,4 +1,10 @@
$Id: history.txt,v 1.291 2005/10/11 16:05:15 jrandom Exp $ $Id: history.txt,v 1.292 2005/10/12 22:54:54 jrandom Exp $
2005-10-13 jrandom
* SSU retransmission choke bugfix (== != !=)
* Include initial transmissions in the retransmission choke, so that
if we are already retransmitting a message, we won't send anything
to that peer other than that message (or ACKs, if necessary)
2005-10-12 jrandom 2005-10-12 jrandom
* Choke SSU retransmissions to a peer while there is already a * Choke SSU retransmissions to a peer while there is already a

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
* *
*/ */
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.266 $ $Date: 2005/10/11 16:05:14 $"; public final static String ID = "$Revision: 1.267 $ $Date: 2005/10/12 22:54:54 $";
public final static String VERSION = "0.6.1.2"; public final static String VERSION = "0.6.1.2";
public final static long BUILD = 7; public final static long BUILD = 8;
public static void main(String args[]) { public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID); System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -344,6 +344,14 @@ public class OutboundMessageFragments {
_log.info("Fragmenting " + state); _log.info("Fragmenting " + state);
} }
OutboundMessageState curRetransMsg = (OutboundMessageState)_retransmitters.get(peer);
if ( (curRetransMsg != null) && (curRetransMsg != state) ) {
// choke it, since there's already another message retransmitting to this
// peer.
_context.statManager().addRateData("udp.blockedRetransmissions", peer.getPacketsRetransmitted(), peer.getPacketsTransmitted());
return false;
}
int size = state.getUnackedSize(); int size = state.getUnackedSize();
if (peer.allocateSendingBytes(size)) { if (peer.allocateSendingBytes(size)) {
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
@ -354,17 +362,8 @@ public class OutboundMessageFragments {
+ " for message " + state.getMessageId() + ": " + state); + " for message " + state.getMessageId() + ": " + state);
if (state.getPushCount() > 0) { if (state.getPushCount() > 0) {
OutboundMessageState curRetransMsg = (OutboundMessageState)_retransmitters.get(peer); _retransmitters.put(peer, state);
if ( (curRetransMsg != null) && (curRetransMsg == state) ) {
// choke it, there's already another message to this peer in flight
// perhaps we should release the sendingBytes? or maybe not, since we
// *do* want to choke the peer...
_context.statManager().addRateData("udp.blockedRetransmissions", peer.getPacketsRetransmitted(), peer.getPacketsTransmitted());
return false;
} else {
_retransmitters.put(peer, state);
}
int fragments = state.getFragmentCount(); int fragments = state.getFragmentCount();
int toSend = 0; int toSend = 0;
for (int i = 0; i < fragments; i++) { for (int i = 0; i < fragments; i++) {