# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1264503380 -7200 # Node ID 2df28d7a2299d3ce365c7203a66b2f033dab9e47 # Parent ef893827b4d1ddea11ed5a16c0f34e305ae4879d Revision: 201001 Kit: 201004 diff -r ef893827b4d1 -r 2df28d7a2299 vpnengine/ikev2lib/src/ikev2messagesendqueue.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 ) { diff -r ef893827b4d1 -r 2df28d7a2299 vpnengine/vpncleaner/src/vpncleanerexe.cpp --- 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; }