diff -r 10852b179f64 -r ea98413ce11f supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp --- a/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp Wed Sep 15 12:40:28 2010 +0300 +++ b/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp Wed Oct 13 15:01:35 2010 +0300 @@ -23,7 +23,7 @@ #endif #include #include -#include //For OCC + #include "epos_csuplserverprivatecrkeys.h" #include "epos_csuplconnection.h" #include "epos_csuplsocketreader.h" @@ -125,7 +125,7 @@ iState(ENotConnected), iPacket(0, 0), iVariantEnabled(ETrue), iPskTLSUsage(EFalse), iStartedListen(EFalse), iConnectStarted( EFalse), iSendInProgress(EFalse), iFirstPkt(EFalse), - iListenCount(0), iPrompt(EFalse), iWlanOnly(EFalse) + iListenCount(0) { iHostAddress.Zero(); CActiveScheduler::Add(this); @@ -319,10 +319,8 @@ // Cancel Any outstanding request Cancel(); - if (iTrace) - iTrace->Trace(_L( - "CSuplConnection::Destructor...Deleting Socket Reader"), - KTraceFileName, __LINE__); + iTrace->Trace(_L("CSuplConnection::Destructor...Deleting Socket Reader"), + KTraceFileName, __LINE__); //Delete the Socket Reader delete iSocketReader; @@ -969,12 +967,7 @@ { aStatus = KRequestPending; TRequestStatus *reqStatus = &aStatus; - TInt error = iConnArray.Append(reqStatus); - if (error != KErrNone) - { - User::RequestComplete(reqStatus, error); - return; - } + iConnArray.Append(reqStatus); } if (!iConnectStarted) @@ -990,40 +983,14 @@ iConnectStarted = ETrue; #ifndef __WINS__ - TExtendedConnPref OCCPrefs; - TConnPrefList prefList; - - OCCPrefs.SetForcedRoaming(EFalse); //do not switch networks during an ongoing connection - OCCPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourDefault); - - if(iIAPId != -1) //if a IAP was configured - - { - iTrace->Trace(_L("CSuplConnection::Connect : IAP configured"), KTraceFileName, __LINE__); - OCCPrefs.SetIapId(iIAPId); - // since IAP Id is set SNAP purpose should not be set - set to unknown - OCCPrefs.SetSnapPurpose(CMManager::ESnapPurposeUnknown); - OCCPrefs.SetBearerSet(TExtendedConnPref::EExtendedConnBearerUnknown); - } - else - { - OCCPrefs.SetSnapPurpose(CMManager::ESnapPurposeInternet); - //WLAN and Cellular Networks allowed for connection - OCCPrefs.SetBearerSet(TExtendedConnPref::EExtendedConnBearerWLAN | TExtendedConnPref::EExtendedConnBearerCellular); - - //if SNAP purpose is set IAP Id should be zero - zero by default not explicitly set - iTrace->Trace(_L("CSuplConnection::Connect : IAP not configured"), KTraceFileName, __LINE__); - } - - TRAP_IGNORE(prefList.AppendL(&OCCPrefs)); + TCommDbConnPref prefs; + prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); + prefs.SetDirection(ECommDbConnectionDirectionOutgoing); + prefs.SetIapId(iIAPId); TInt ret = iConnection.Open(iSocketServ); - if(ret != KErrNone) - iTrace->Trace(_L("RConnection Open returned error"), KTraceFileName, __LINE__); - - iTrace->Trace(_L("RConnection Start Called, State is ERetriveIAP"), KTraceFileName, __LINE__); // Start an Outgoing Connection with overrides - iConnection.Start(prefList,iStatus); + iConnection.Start(prefs,iStatus); // Set state to ERetriveIAP iState = ERetriveIAP; SetActive(); @@ -1043,111 +1010,6 @@ } // ----------------------------------------------------------------------------- -// CSuplConnection::Connect -// Makes a secure connection to Network -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -EXPORT_C void CSuplConnection::Connect(TRequestStatus &aStatus, - TBool aPrompt, TBool aWlanOnly) - { - - // Log - iTrace->Trace(_L("CSuplConnection::Connect"), KTraceFileName, __LINE__); - iPrompt = aPrompt; - iWlanOnly = aWlanOnly; - - aStatus = KRequestPending; - TRequestStatus *reqStatus = &aStatus; - - if (iState == EConnected) - { - User::RequestComplete(reqStatus, KErrNone); - iConnectClients++; - return; - } - - TInt error = iConnArray.Append(reqStatus); - if (error != KErrNone) - { - User::RequestComplete(reqStatus, error); - return; - } - - if (!iConnectStarted) - { - iTrace->Trace( - _L("CSuplConnection::Connect : Connection not started"), - KTraceFileName, __LINE__); - // Connect only if not already connected - if (iState == ENotConnected || iState == EFailure) - { - iTrace->Trace(_L("CSuplConnection::Connect : ENotConnected"), - KTraceFileName, __LINE__); - iConnectStarted = ETrue; - -#ifndef __WINS__ - - iTrace->Trace(_L("CSuplConnection::Connect ExtendedConnPref"), KTraceFileName, __LINE__); - - TExtendedConnPref OCCPrefs; - TConnPrefList prefList; - - if(iWlanOnly) - { - iTrace->Trace(_L("CSuplConnection::Connect : iWLANOnly used"), KTraceFileName, __LINE__); - OCCPrefs.SetBearerSet(TExtendedConnPref::EExtendedConnBearerWLAN); - } - else - { - iTrace->Trace(_L("CSuplConnection::Connect OCC GPRS Connection.."), KTraceFileName, __LINE__); - OCCPrefs.SetBearerSet(TExtendedConnPref::EExtendedConnBearerCellular); - } - OCCPrefs.SetSnapPurpose(CMManager::ESnapPurposeInternet); - - if(!iPrompt) - { - iTrace->Trace(_L("CSuplConnection::Connect : silent connection"), KTraceFileName, __LINE__); - OCCPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent); - } - else - { - iTrace->Trace(_L("CSuplConnection::Connect : Dialog prompt"), KTraceFileName, __LINE__); - OCCPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourDefault); - } - - TRAP_IGNORE(prefList.AppendL(&OCCPrefs)); - - TInt ret = iConnection.Open(iSocketServ); - if( ret != KErrNone ) - { - TRequestStatus* statusPtr = &aStatus; - User::RequestComplete( statusPtr,ret ); - return; - } - // Start an Outgoing Connection with overrides - iConnection.Start(prefList,iStatus); - // Set state to ERetriveIAP - iState = ERetriveIAP; - SetActive(); - -#else - ConnectIAP(); -#endif - } - } - else - iTrace->Trace( - _L( - "CSuplConnection::Connect : Conn in progress, request queued"), - KTraceFileName, __LINE__); - // Log - iTrace->Trace(_L("CSuplConnection::Connect:Exit"), KTraceFileName, - __LINE__); - } - -// ----------------------------------------------------------------------------- // CSuplConnection::CompleteConnectStatus // Completes the request to cancel connection // (other items were commented in a header). @@ -1364,7 +1226,6 @@ SetActive(); } } - // ----------------------------------------------------------------------------- // CSuplConnection::ConnectIAP // Makes a socket connection to Network