Commit b973f1c3 authored by Pramod R Sanaga's avatar Pramod R Sanaga
Browse files

Array index counting the number of ACKs was being double incremented - fixed.

Change in the wrap around compare function - to take sender timestamps into account.
parent f7d48f67
......@@ -161,7 +161,6 @@ void UdpAvgThroughputSensor::localAck(PacketInfo *packet)
ackList[queuePtr] = tmpUdpAck;
queuePtr = (queuePtr + 1)%MAX_SAMPLES;
numSamples++;
if(numSamples < MAX_SAMPLES)
numSamples++;
......@@ -199,14 +198,14 @@ void UdpAvgThroughputSensor::calculateTput(unsigned long long timeStamp)
return;
}
if(timePeriod > 500000)
if(timePeriod > 5000000)
{
logWrite(ERROR, " Incorrect UdpAvgThroughput timePeriod = %llu, bytes = %d, i = %d, queuePtr = %d", timePeriod, packetSizeSum, i, queuePtr);
logWrite(ERROR, " Incorrect UdpAvgThroughput timePeriod = %llu, bytes = %d, i = %d, numSamples = %d, sampleCount = %d queuePtr = %d", timePeriod, packetSizeSum, i,numSamples,sampleCount, queuePtr);
int k;
for(k = 0; k < i; k++)
{
index = (queuePtr -1 - k + MAX_SAMPLES)%MAX_SAMPLES;
logWrite(ERROR, "Wrong UDP seqnum = %d, bytes = %d, timePeriod = %llu, isRedun = %d", ackList[index].seqNum, ackList[index].packetSize, ackList[index].timeTaken, ackList[index].isRedun);
logWrite(ERROR, "Wrong UDP seqnum = %d, index = %d, bytes = %d, timePeriod = %llu, isRedun = %d", ackList[index].seqNum,index, ackList[index].packetSize, ackList[index].timeTaken, ackList[index].isRedun);
}
return;
......
......@@ -414,7 +414,7 @@ class lessSeqNum:public std::binary_function<UdpPacketInfo , UdpPacketCmp *,bool
public:
bool operator()(const UdpPacketInfo& packet,UdpPacketCmp *cmpPacket) const
{
return ( (packet.seqNum < cmpPacket->seqNum) && (packet.timeStamp < cmpPacket->timeStamp));
return ( (packet.timeStamp < cmpPacket->timeStamp));
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment