Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 10:48:33 +0300
branchRCL_3
changeset 26 74294b43d401
parent 23 d1a0d37b52a1
child 32 352850cbed81
Revision: 201021 Kit: 2010123
vpnengine/vpnconnagt/src/vpnconnagt.cpp
vpnengine/vpnconnagt/src/vpnsipobserver.cpp
--- a/vpnengine/vpnconnagt/src/vpnconnagt.cpp	Tue May 25 13:48:10 2010 +0300
+++ b/vpnengine/vpnconnagt/src/vpnconnagt.cpp	Wed Jun 09 10:48:33 2010 +0300
@@ -127,6 +127,7 @@
 //
 inline void CVPNConnAgt::ConstructL()
     {
+    
     LOG_1("[0x%08x] Constructing VPN Connection Agent\n", this);
     // construct the database and dialog processor
     CAgentBase::ConstructL();
@@ -332,8 +333,10 @@
     if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
         {
         // For some reason, if the request fails, just proceeds.
-        if ( iSipObserver->RequestDeregister() != KErrNone )
+        TInt err = iSipObserver->RequestDeregister();
+        if ( err != KErrNone )
             {
+            LOG_1( "CVPNConnAgt::ServiceStarted:  iSipObserver->RequestDeregister failed with %d", err );
             ProceedServiceStart();
             }
         // Return for now. ProceedServiceStart() will be called later by iSipObserver when
@@ -473,7 +476,11 @@
         {
         // SIP is re-registered when a VPN session ends.
         // Note: return value ignored. Nothing to do here for error cases.
-        iSipObserver->RequestRegister();
+        TInt err = iSipObserver->RequestRegister();
+        if (err != KErrNone)
+            {
+            LOG(Log::Printf(_L("SipObserver->RequestRegister failed with %d\n"), err));
+            }
         }
 
     iNotify->AgentProgress(EVPNConnAgtDisconnected, KErrNone);
@@ -572,7 +579,11 @@
                 {
                 // SIP is re-registered when a VPN session ends.
                 // Note: return value ignored. Nothing to do here for error cases.
-                iSipObserver->RequestRegister();
+                TInt err = iSipObserver->RequestRegister();
+                if (err != KErrNone)
+                    {
+                    LOG(Log::Printf(_L("SipObserver->RequestRegister failed with %d\n"), err));
+                    }
                 }    
             
             closeData = (TCloseVpnConnEventData*)(aData->Ptr());
--- a/vpnengine/vpnconnagt/src/vpnsipobserver.cpp	Tue May 25 13:48:10 2010 +0300
+++ b/vpnengine/vpnconnagt/src/vpnsipobserver.cpp	Wed Jun 09 10:48:33 2010 +0300
@@ -108,23 +108,24 @@
 //             
 void CVpnSipObserver::RunL()
     {
+    LOG_1( "CVpnSipObserver::RunL iStatus = %d", iStatus.Int());
     if ( iStatus == KErrNone ) 
         {
         TInt val = 0;
         // SIP Profile Server notified completion of SIP deregistration.
-        TInt err = iSIPProperty.Get( KPSVpnSipUid, KVpnSipState, val );
-        
-        if ( err == KErrNone )
+        TInt err = iSIPProperty.Get( KPSVpnSipUid, KVpnSipState, val );        
+        if ( err == KErrNone && val == ESipDeregisterCompleted )
             {
             // If SIP is deregistered, let the VPN Connection Agent to 
             // proceed VPN session start.
-            if ( val == ESipDeregisterCompleted )
-                {
-                iAgent.ProceedServiceStart();
-                }
+            LOG_( "CVpnSipObserver::RunL SIP is deregistered. VPN Connection Agent continue with VPN start." );
+            iAgent.ProceedServiceStart();            
             }
-        // Keep monitoring.
-        Subscribe();
+        else
+            {
+            // Keep monitoring.
+            Subscribe();
+            }
         }
     // Check if observer can be restarted.
     else if ( iStatus != KErrCancel