Changeset 6812dc1


Ignore:
Timestamp:
Aug 31, 2013 6:39:29 PM (8 years ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
615a5f3
Parents:
41595ca
Message:

Ticket #1007 use only non-retransmitted packets in RTT

sampling. (RFC 6298)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java

    r41595ca r6812dc1  
    291291            // use the highest RTT, since these would likely be bunched together,
    292292            // and the highest rtt lets us set our resend delay properly
     293            // RFC 6298 part 3 dictates only use packets that haven't been re-sent.
    293294            int highestRTT = -1;
    294295            for (int i = 0; i < acked.size(); i++) {
    295296                PacketLocal p = acked.get(i);
    296                 if (p.getAckTime() > highestRTT) {
    297                     //if (p.getNumSends() <= 1)
    298                     highestRTT = p.getAckTime();
    299                 }
    300                 _context.statManager().addRateData("stream.sendsBeforeAck", p.getNumSends(), p.getAckTime());
    301                
    302                 if (p.getNumSends() > 1)
     297               
     298                final int numSends = p.getNumSends();
     299                final int ackTime = p.getAckTime();
     300               
     301                if (numSends > 1)
    303302                    numResends++;
     303                else if (ackTime > highestRTT)
     304                    highestRTT = ackTime;
     305               
     306                _context.statManager().addRateData("stream.sendsBeforeAck", numSends, ackTime);
     307               
    304308               
    305309                // ACK the tags we delivered so we can use them
     
    311315                //}
    312316                if (_log.shouldLog(Log.DEBUG))
    313                     _log.debug("Packet acked after " + p.getAckTime() + "ms: " + p);
     317                    _log.debug("Packet acked after " + ackTime + "ms: " + p);
    314318            }
    315319            if (highestRTT > 0) {
Note: See TracChangeset for help on using the changeset viewer.