ticket #1062 - count duplicate packets towards RTT if we have

never sampled it
This commit is contained in:
zab2
2013-10-13 17:05:59 +00:00
parent 20b2f7dcb1
commit d0f635e30c
2 changed files with 6 additions and 1 deletions

View File

@ -629,6 +629,10 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
computeRTO();
}
public synchronized boolean receivedAck() {
return _initState != AckInit.INIT;
}
/** How long after sending a packet will we wait before resending?
* @return delay for a retransmission in ms
*/

View File

@ -299,6 +299,7 @@ class ConnectionPacketHandler {
return false;
boolean lastPacketAcked = false;
final boolean receivedAck = con.getOptions().receivedAck();
if ( (acked != null) && (!acked.isEmpty()) ) {
if (_log.shouldLog(Log.DEBUG))
_log.debug(acked.size() + " of our packets acked with " + packet);
@ -312,7 +313,7 @@ class ConnectionPacketHandler {
final int numSends = p.getNumSends();
final int ackTime = p.getAckTime();
if (numSends > 1)
if (numSends > 1 && receivedAck)
numResends++;
else if (ackTime > highestRTT)
highestRTT = ackTime;