hotspotfw/hsserver/src/hotspotsession.cpp
branchRCL_3
changeset 18 aaabc7526ded
parent 14 d9aaeb96a256
child 20 a9524956f6b5
--- a/hotspotfw/hsserver/src/hotspotsession.cpp	Tue May 25 13:53:32 2010 +0300
+++ b/hotspotfw/hsserver/src/hotspotsession.cpp	Wed Jun 09 10:53:40 2010 +0300
@@ -625,35 +625,34 @@
     switch ( aResult )
         {
         case EConnectionOk :
-            indx = iServer.FindMessage( iIapId, EHssStartLogin );
-            if ( KErrNotFound != indx )
-                {
-                iServer.CompleteMessage( indx, KErrNone );    
-                }
-            TRAPD( trap, iIapSettingsHandler->CreateIapL() );
-            if ( trap != KErrNone )
-                {
-                DEBUG1("CHotSpotSession::ConnectivityObserver trap: %d", trap);
-                }
-            break;
-        case EHttpAuthenticationNeeded :
-            // Start browser for authentication
-            TRAP_IGNORE( AuthenticateL( aString ) );
-            break;
-        case EConnectionNotOk :
+            // Create IAP first, then complete the message to connection.
+            TRAP_IGNORE( iIapSettingsHandler->CreateIapL() );
             indx = iServer.FindMessage( iIapId, EHssStartLogin );
             if ( KErrNotFound != indx )
                 {
                 iServer.CompleteMessage( indx, KErrNone );    
                 }
             break;
+        case EHttpAuthenticationNeeded :
+            // Start browser for authentication
+            TRAPD( browserStarted, AuthenticateL( aString ) );
+            if ( browserStarted != KErrNone )
+                {
+                // Starting of browser leaved. Complete the message.
+                indx = iServer.FindMessage( iIapId, EHssStartLogin );
+                if ( KErrNotFound != indx )
+                    {
+                    iServer.CompleteMessage( indx, KErrNone );    
+                    }
+                }
+            break;
+        case EConnectionNotOk :
         case ETimeout :
             indx = iServer.FindMessage( iIapId, EHssStartLogin );
             if ( KErrNotFound != indx )
                 {
                 iServer.CompleteMessage( indx, KErrNone );    
                 }
-            
             break;
         default:
             break;