networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp
changeset 66 34ec136802c5
parent 51 78fceed50f62
--- a/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp	Thu Sep 02 22:05:12 2010 +0300
+++ b/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp	Fri Sep 17 08:38:11 2010 +0300
@@ -1198,7 +1198,7 @@
 			// Start linger timer. RSocket::Close() returns when timer
 			// expires or when all data has been succesfully transmitted.
 			//
-			iLingerTimer->Start(iLinger * KOneSecondUs);
+			iLingerTimer->Start(iLinger * KOneSecondInUs);
 			}
 		SchedTransmit();
 
@@ -1788,7 +1788,7 @@
 			{
 			// The heaviest time check only if we are otherwise allowed to send the keepalive.
 			TUint32 time_now = TimeStamp();
-			if (time_now - iLastTriggeredKeepAlive > KTcpKeepAliveTH * KOneSecondUs)
+			if (time_now - iLastTriggeredKeepAlive > KTcpKeepAliveTH * KOneSecondInMs)
 				{
 				iLastTriggeredKeepAlive = time_now;
 				LOG(Log::Printf(_L("\ttcp SAP[%u] CanSend(): Sending a Keep-Alive probe"), (TInt)this));
@@ -2447,7 +2447,7 @@
 	if (!iLastTimeout)
 		iLastTimeout = usec;
 
-	TUint32 distance = (usec - iLastTimeout) / KOneSecondUs;  // seconds
+	TUint32 distance = (usec - iLastTimeout) / KOneSecondInMs;  // seconds
 	TUint32 interval = iBackoff ? Protocol()->KeepAliveRxmt() : Protocol()->KeepAliveIntv();
 
 	if (distance > interval)
@@ -2456,14 +2456,14 @@
 		LOG(Log::Printf(_L("\ttcp SAP[%u] KeepAliveTimeout(): Sending a Keep-Alive probe"), (TInt)this));
 		SendSegment(KTcpCtlACK, iSND.UNA - 1, 0);
 		iBackoff++;
-		iRetransTimer->Restart(Protocol()->KeepAliveRxmt() * KOneSecondUs);
+		iRetransTimer->Restart(Protocol()->KeepAliveRxmt() * KOneSecondInUs);
 		}
 	else
 		{
 		// This branch is entered when the first keepalive has to be issued after an idle period.
 		distance = Protocol()->KeepAliveIntv() - distance;
 		iRetransTimer->Restart((distance > 1800) ?
-			1800 * KOneSecondUs : (distance * KOneSecondUs));
+			1800 * KOneSecondInUs : (distance * KOneSecondInUs));
 		}
 	}
 
@@ -2472,7 +2472,7 @@
 	{
 	ASSERT(iRetransTimer);
 	iRetransTimer->Restart((Protocol()->KeepAliveIntv() > 1800) ?
-		1800 * KOneSecondUs : (Protocol()->KeepAliveIntv() * KOneSecondUs));
+		1800 * KOneSecondInUs : (Protocol()->KeepAliveIntv() * KOneSecondInUs));
 	// Backoff is used for counting unacknowledged keepalive retransmissions during idle periods
 	iBackoff = 0;
 	iLastTimeout = TimeStamp();
@@ -3718,6 +3718,13 @@
 							iDupAcks = Max(iDupAcks - acked / (TInt)iSMSS, 0);
 							}
 						}
+					else if ( iDupAcks )
+                        {
+                        // New data acknowledged, and not ongoing any recovery action
+                        // Reset duplicate ack count
+                        LOG(Log::Printf(_L("\ttcp SAP[%u] ProcessSegments(): Reset iDupAcks to 0"), (TInt)this));
+                        iDupAcks = 0;
+                        }
 
 					// Reset limited transmit window
 					iLwnd = 0;
@@ -3893,6 +3900,9 @@
 						iFlags.iEcnSendCWR = ETrue;
 						}
 					}
+				// This section used to hold the RetryACK concept, a reference can be checked
+				// from older versions(9.2/9.3). Its being removed as not required.
+				/*
 				if((iSND.NXT - ack) >0 && InState(ETcpEstablished) && (acked ==0))
 					{
 					iRetryAck++;
@@ -3903,6 +3913,7 @@
 						iRetryAck = 0; // reset the retry count
 						}
 					}
+					*/
 					
 				}
 			}