# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284491373 -10800 # Node ID fce0ae2e42239f4332d5de90b1541376004c73de # Parent 6b6920c56e2f83335aa8e3ca5d611d360aebd055 Revision: 201033 Kit: 201035 diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasuplstate.h --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasuplstate.h Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasuplstate.h Tue Sep 14 22:09:33 2010 +0300 @@ -24,8 +24,6 @@ #ifdef _DEBUG #define PRINT_MESSAGE #endif -#define PRINT_MESSAGE -//#undef PRINT_MESSAGE /** MOMASuplMsgStateObserver Notifies about complaetion of operation with or without error. diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp Tue Sep 14 22:09:33 2010 +0300 @@ -155,7 +155,7 @@ LogBuffer.AppendNum(err); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - CleanupStack::PopAndDestroy(&newParam); + CleanupStack::PopAndDestroy(newParam); } else { @@ -176,7 +176,7 @@ delete iapName; } - CleanupStack::PopAndDestroy(¶m); + CleanupStack::PopAndDestroy(param); iTrace->Trace(_L("Fallback allowed & TLSAuth failed"),KTraceFileName, __LINE__); iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplstate.h --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplstate.h Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplstate.h Tue Sep 14 22:09:33 2010 +0300 @@ -24,8 +24,6 @@ #ifdef _DEBUG #define PRINT_MESSAGE #endif -#define PRINT_MESSAGE -//#undef PRINT_MESSAGE /** MOMASuplMsgStateObserver Notifies about complaetion of operation with or without error. diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp Tue Sep 14 22:09:33 2010 +0300 @@ -154,7 +154,7 @@ LogBuffer.AppendNum(err); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - CleanupStack::PopAndDestroy(&newParam); + CleanupStack::PopAndDestroy(newParam); } else { @@ -175,7 +175,7 @@ delete iapName; } - CleanupStack::PopAndDestroy(¶m); + CleanupStack::PopAndDestroy(param); iTrace->Trace(_L("Fallback allowed & TLSAuth failed"),KTraceFileName, __LINE__); iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationsuplfw/protocolhandlerapi/inc/epos_csuplconnection.h --- a/supl/locationsuplfw/protocolhandlerapi/inc/epos_csuplconnection.h Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationsuplfw/protocolhandlerapi/inc/epos_csuplconnection.h Tue Sep 14 22:09:33 2010 +0300 @@ -392,7 +392,7 @@ TBool iPskTLSUsage; TBool iStartedListen; - + TBool iConnectStarted; TBool iSendInProgress; diff -r 6b6920c56e2f -r fce0ae2e4223 supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp --- a/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp Wed Sep 01 12:24:21 2010 +0100 +++ b/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplconnection.cpp Tue Sep 14 22:09:33 2010 +0300 @@ -989,12 +989,6 @@ prefs.SetIapId(iIAPId); TInt ret = iConnection.Open(iSocketServ); - if( ret != KErrNone ) - { - TRequestStatus* statusPtr = &aStatus; - User::RequestComplete( statusPtr,ret ); - return; - } // Start an Outgoing Connection with overrides iConnection.Start(prefs,iStatus); // Set state to ERetriveIAP @@ -1025,99 +1019,92 @@ 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; - } + iTrace->Trace(_L("CSuplConnection::Connect"), KTraceFileName, __LINE__); + iPrompt = aPrompt; + iWlanOnly = aWlanOnly; + + if (iState == EConnected) + { + aStatus = KRequestPending; + TRequestStatus *reqStatus = &aStatus; + 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__); + // Check if Connect() is started. If started, add status to Q + //if (iConnectStarted) + // { + aStatus = KRequestPending; + TRequestStatus *reqStatus = &aStatus; + iConnArray.Append(reqStatus); + // } + + 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__); + 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); - } - + if(iWlanOnly) + { + iTrace->Trace(_L("CSuplConnection::Connect : iWLANOnly used"), KTraceFileName, __LINE__); + OCCPrefs.SetBearerSet(TExtendedConnPref::EExtendedConnBearerWLAN); + OCCPrefs.SetSnapPurpose(CMManager::ESnapPurposeInternet); + } + else + { + iTrace->Trace(_L("CSuplConnection::Connect using OCC"), KTraceFileName, __LINE__); + 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 = &iStatus; - User::RequestComplete( statusPtr,ret ); - return; - } // Start an Outgoing Connection with overrides iConnection.Start(prefList,iStatus); // Set state to ERetriveIAP - iState = ERetriveIAP; - SetActive(); - + iState = ERetriveIAP; + SetActive(); + + + #else ConnectIAP(); #endif + } } - } - else - iTrace->Trace( - _L( - "CSuplConnection::Connect : Conn in progress, request queued"), - KTraceFileName, __LINE__); + else + iTrace->Trace(_L("CSuplConnection::Connect : Conn in progress, request queued"), KTraceFileName, __LINE__); // Log - iTrace->Trace(_L("CSuplConnection::Connect:Exit"), KTraceFileName, - __LINE__); + iTrace->Trace(_L("CSuplConnection::Connect:Exit"), KTraceFileName, __LINE__); } // -----------------------------------------------------------------------------