Revision: 201001 PDK_3.0.f
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 12:56:20 +0200
changeset 3 2df28d7a2299
parent 2 ef893827b4d1
child 4 29b591713d44
Revision: 201001 Kit: 201004
vpnengine/ikev2lib/src/ikev2messagesendqueue.cpp
vpnengine/vpncleaner/src/vpncleanerexe.cpp
--- a/vpnengine/ikev2lib/src/ikev2messagesendqueue.cpp	Mon Jan 18 21:14:04 2010 +0200
+++ b/vpnengine/ikev2lib/src/ikev2messagesendqueue.cpp	Tue Jan 26 12:56:20 2010 +0200
@@ -164,7 +164,7 @@
     DEBUG_LOG1(_L("CIkev2MessageSendQueue::NewSaBehindNatL: SaId=%d"), aSaId);
     __ASSERT_DEBUG(iSasBehindNat.Find(aSaId) == KErrNotFound, User::Invariant());
     User::LeaveIfError(iSasBehindNat.Append(aSaId));    
-    if (!iSender->IsActive() && iNatKeepAliveInterval > 0)
+    if (!IsActive() && !iSender->IsActive() && iNatKeepAliveInterval > 0)
         {
         //No sending acticve arm the nat keepalive timer.
         ArmKeepaliveTimer();
@@ -221,6 +221,7 @@
 void CIkev2MessageSendQueue::ArmKeepaliveTimer()
     {
     DEBUG_LOG(_L("CIkev2MessageSendQueue::ArmKeepaliveTimer"));    
+    __ASSERT_DEBUG(!IsActive(), User::Invariant());
     //Arm NAT keepalive timer.
     if (iNatKeepAliveInterval > KMaxTInt/1000000 ) 
         {
--- a/vpnengine/vpncleaner/src/vpncleanerexe.cpp	Mon Jan 18 21:14:04 2010 +0200
+++ b/vpnengine/vpncleaner/src/vpncleanerexe.cpp	Tue Jan 26 12:56:20 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:   Cleans VPN data from device
+* Description:  Cleans VPN data from device
 *
 */
 
@@ -23,20 +23,27 @@
 #include "vpncleaner.h"
 
 
-LOCAL_C void setKeysL();
+LOCAL_C void  setKeysL();
+LOCAL_C TBool vpnOnRom();
 
 
 // The starting point
 GLDEF_C TInt E32Main()
     {
     __UHEAP_MARK;
+
     CTrapCleanup* cleanup = CTrapCleanup::New();
-    
-    TVpnCleaner vpnc;
-    vpnc.Clean();
-    
-    TRAP_IGNORE( setKeysL() );
+
+    if( EFalse == vpnOnRom() )
+        {
+        TVpnCleaner vpnc;
+        vpnc.Clean();
+
+        TRAP_IGNORE( setKeysL() );
+        }
+
     delete cleanup;
+
     __UHEAP_MARKEND;
     return KErrNone;
     }
@@ -45,27 +52,37 @@
 LOCAL_C void setKeysL()
     {
     // Connecting and initialization:
-    CRepository* repository = CRepository::NewL( 
+    CRepository* repository = CRepository::NewL(
         KCRUidCommunicationSettings );
-    
+
+    repository->Set( KSettingsVPNSupported, 0 );
+    repository->Delete( KSettingsVPNImplementation );
+
+    delete repository;
+    }
+
+
+LOCAL_C TBool vpnOnRom()
+    {
+    TBool ret = EFalse;
+
     TUint fileAttr;
     RFs fs;
     TInt err = fs.Connect();
-    
+
     if ( KErrNone == err )
         {
-        _LIT( KRomPath, "z:\\sys\\bin\\kmdserver.exe" ); 
-        
-        if ( KErrNone != fs.Att( KRomPath, fileAttr ) )
+        _LIT( KRomPath, "z:\\sys\\bin\\kmdserver.exe" );
+
+        if ( KErrNone == fs.Att( KRomPath, fileAttr ) )
             {
-            repository->Set( KSettingsVPNSupported, 0 );
-            repository->Delete( KSettingsVPNImplementation );
+            ret = ETrue;
             }
         }
 
     fs.Close();
 
-    delete repository;
+    return ret;
     }