fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp
branchRCL_3
changeset 9 57a65a3a658c
parent 0 b497e44ab2fc
child 21 490439ac0bd4
--- a/fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp	Tue Feb 02 00:44:00 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp	Fri Feb 19 23:41:35 2010 +0200
@@ -1387,7 +1387,8 @@
 
 	// 2/3 GET IAP FROM ESOCK ----------------------------------------------
 	// resolve which accespoint is used for current DM session
-	if ( profIapid == KErrNotFound && aIapid==KErrNotFound)
+	if ( (profIapid == KErrNotFound || profIapid == KErrGeneral)  
+			&& aIapid==KErrNotFound)
 		{
 		RSocketServ serv;
 		CleanupClosePushL( serv );
@@ -1451,8 +1452,8 @@
 		CleanupStack::PopAndDestroy( 2 ); // conn, serv		
 		}
 	TInt newIapid( KErrNotFound );
-	if ( sockIapid!=KErrNotFound ) newIapid = sockIapid;
-	if ( profIapid!=KErrNotFound ) newIapid = profIapid;
+	if ( sockIapid!=KErrNotFound  ) newIapid = sockIapid;
+	if ( profIapid!=KErrNotFound && profIapid != KErrGeneral ) newIapid = profIapid;
 	if ( aIapid   !=KErrNotFound ) newIapid = aIapid;
 
 	//Do some intelligent work during resume
@@ -1468,17 +1469,17 @@
 	if (active==EFalse && iDLState.iState == RFotaEngineSession::EDownloadProgressingWithResume)
 		{
 		//Actual resume only
-		if (!iUserInitiatedResume && profIapid == KErrNotFound  )
+		if (!iUserInitiatedResume && (profIapid == KErrNotFound || profIapid == KErrGeneral  ) )
 			{
 			//FMS triggered resume, apply Rule 1
 			newIapid = iDLState.iIapId;
 			}
-		else if (profIapid == KErrNotFound)
+		else if (profIapid == KErrNotFound || profIapid == KErrGeneral )
 			{
 			//User triggered resume, apply Rule 2
 			newIapid = KErrNotFound;
 			}
-		else if (profIapid != iDLState.iIapId)
+		else if (profIapid != iDLState.iIapId && profIapid > KErrNone)
 			{
 			//IAP has changed in DM profile, apply Rule 3
 			newIapid = profIapid;