# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274783777 -10800 # Node ID 2de6635c154b7dd0996a7328c87bd6a85f576e13 # Parent 915074efc433d1edd510367c3ce7762fbf1b93e9 Revision: 201019 Kit: 2010121 diff -r 915074efc433 -r 2de6635c154b syncmlfw/common/http/src/nsmlhttpclient.cpp --- a/syncmlfw/common/http/src/nsmlhttpclient.cpp Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/common/http/src/nsmlhttpclient.cpp Tue May 25 13:36:17 2010 +0300 @@ -19,6 +19,9 @@ #include "nsmlhttpclient.h" #include "nsmlerror.h" #include +#include "NsmlOperatorErrorCRKeys.h" +#include + //Fix to Remove the Bad Compiler Warnings #ifndef __WINS__ @@ -129,10 +132,21 @@ status = CNSmlHTTP::SetErrorStatus( status ); if (status == resp.StatusCode() ) - { - DBG_FILE( _S8("Error in Communication string is set")); - status = TNSmlError::ESmlCommunicationInterrupted; - } + { + if( this->iAgent->iSession == ESyncMLDSSession ) + { + CRepository* rep = NULL; + TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); + if ( err == KErrNone ) + { + rep->Set( KNsmlOpDsErrorCode, status ); + delete rep; + } + } + + DBG_FILE( _S8("Error in Communication string is set")); + status = TNSmlError::ESmlCommunicationInterrupted; + } // content mismatch aTransaction.Close(); diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def --- a/syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def Tue May 25 13:36:17 2010 +0300 @@ -55,6 +55,5 @@ ?WriteStreamCommitL@CNSmlDSProfile@@QAEXXZ @ 54 NONAME ; void CNSmlDSProfile::WriteStreamCommitL(void) ?IsOperatorProfileL@CNSmlDSSettings@@QAEHABVTDesC16@@@Z @ 55 NONAME ; int CNSmlDSSettings::IsOperatorProfileL(class TDesC16 const &) ?OperatorProfileModValueLC@CNSmlDSSettings@@QAEPAVHBufC8@@XZ @ 56 NONAME ; class HBufC8 * CNSmlDSSettings::OperatorProfileModValueLC(void) - ?StoreSyncType@CNSmlDSSettings@@QAEXABVTDes8@@@Z @ 57 NONAME ; void CNSmlDSSettings::StoreSyncType(class TDes8 const &) - ?OperatorProfileSWVValueLC@CNSmlDSSettings@@QAEPAVHBufC8@@XZ @ 58 NONAME ; class HBufC8 * CNSmlDSSettings::OperatorProfileSWVValueLC(void) + ?OperatorProfileSWVValueLC@CNSmlDSSettings@@QAEPAVHBufC8@@XZ @ 57 NONAME ; class HBufC8 * CNSmlDSSettings::OperatorProfileSWVValueLC(void) diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def --- a/syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def Tue May 25 13:36:17 2010 +0300 @@ -83,8 +83,7 @@ _ZTV26CNSmlDSResourceContentType @ 82 NONAME ; ## _ZTI26CNSmlProfileContentHandler @ 83 NONAME ; ## _ZTV26CNSmlProfileContentHandler @ 84 NONAME ; ## - _ZN15CNSmlDSSettings13StoreSyncTypeERK5TDes8 @ 85 NONAME - _ZN15CNSmlDSSettings18IsOperatorProfileLERK7TDesC16 @ 86 NONAME - _ZN15CNSmlDSSettings25OperatorProfileModValueLCEv @ 87 NONAME - _ZN15CNSmlDSSettings25OperatorProfileSWVValueLCEv @ 88 NONAME + _ZN15CNSmlDSSettings18IsOperatorProfileLERK7TDesC16 @ 85 NONAME + _ZN15CNSmlDSSettings25OperatorProfileModValueLCEv @ 86 NONAME + _ZN15CNSmlDSSettings25OperatorProfileSWVValueLCEv @ 87 NONAME diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/settings/inc/nsmldssettings.h --- a/syncmlfw/ds/settings/inc/nsmldssettings.h Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/settings/inc/nsmldssettings.h Tue May 25 13:36:17 2010 +0300 @@ -390,14 +390,6 @@ */ IMPORT_C HBufC8* OperatorProfileModValueLC(); - /** - * Checks if received Alert Code is a sync type and tries to convert - * it to Sync Type (TSmlSyncType). If conversion is succesful, the - * value is stored into Cenrep file (KCRUidOperatorDatasyncInternalKeys). - * @param aAlertCode received alert code. - */ - IMPORT_C void StoreSyncType( const TDes8& aAlertCode ); - /** * Parse xml * @param - whether data has to be restored from existing database diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/settings/src/NSmlDSSettings.cpp --- a/syncmlfw/ds/settings/src/NSmlDSSettings.cpp Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/settings/src/NSmlDSSettings.cpp Tue May 25 13:36:17 2010 +0300 @@ -31,7 +31,6 @@ #include "nsmldsagconstants.h" #include //CRepository #include // KCRUidOperatorDatasyncInternalKeys -#include // KCRUidOperatorDatasyncErrorKeys _LIT(Kinfile,"z:\\Private\\101F99FB\\VariantData.xml"); const TInt KUrlLength = 256; @@ -983,51 +982,4 @@ return buf; } -//----------------------------------------------------------------------------- -// CNSmlDSSettings::StoreSyncType -// Checks if received Alert Code is a sync type and tries to convert -// it to Sync Type (TSmlSyncType). -//----------------------------------------------------------------------------- -// -EXPORT_C void CNSmlDSSettings::StoreSyncType( const TDes8& aAlertCode ) - { - TInt syncType = KErrNotFound; - - if ( aAlertCode == KNSmlDSTwoWay ) - { - syncType = ESmlTwoWay; - } - else if ( aAlertCode == KNSmlDSOneWayFromServer ) - { - syncType = ESmlOneWayFromServer; - } - else if ( aAlertCode == KNSmlDSOneWayFromClient ) - { - syncType = ESmlOneWayFromClient; - } - else if ( aAlertCode == KNSmlDSSlowSync ) - { - syncType = ESmlSlowSync; - } - else if ( aAlertCode == KNSmlDSRefreshFromServer ) - { - syncType = ESmlRefreshFromServer; - } - else if ( aAlertCode == KNSmlDSRefreshFromClient ) - { - syncType = ESmlRefreshFromClient; - } - - if ( syncType != KErrNotFound ) - { - CRepository* rep = NULL; - TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); - if ( err == KErrNone ) - { - rep->Set( KNsmlOpDsSyncType, syncType ); - delete rep; - } - } - } - // End of File diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/syncagent/inc/NSmlDSAgent.h --- a/syncmlfw/ds/syncagent/inc/NSmlDSAgent.h Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/syncagent/inc/NSmlDSAgent.h Tue May 25 13:36:17 2010 +0300 @@ -578,6 +578,7 @@ TBool iUpdateLastAnchor; //For storing Server Status Code CRepository* iRepositorySSC; + CRepository* iErrorReportingRep; RArray* iServerStatusCodeArray; TBool iIsExtendedServerErrorCodesSupported; }; diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/syncagent/inc/NSmlDSCmds.h --- a/syncmlfw/ds/syncagent/inc/NSmlDSCmds.h Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/syncagent/inc/NSmlDSCmds.h Tue May 25 13:36:17 2010 +0300 @@ -216,6 +216,15 @@ * @param aFinal ETrue if this is the last message from the client. */ void DoEndMessageL( TBool aFinal ); + + /** + * Checks if received Alert Code is a sync type and tries to convert + * it to Sync Type (TSmlSyncType). If conversion is succesful, the + * value is stored into Cenrep file (KCRUidOperatorDatasyncInternalKeys). + * @param aAlertCode received alert code. + */ + void StoreSyncType( const TDes8& aAlertCode ); + private: // constructors and operators /** diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/syncagent/src/nsmldsagent.cpp --- a/syncmlfw/ds/syncagent/src/nsmldsagent.cpp Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/syncagent/src/nsmldsagent.cpp Tue May 25 13:36:17 2010 +0300 @@ -63,8 +63,8 @@ // CONSTANTS const TInt KNSmlDsHTTPErrCodeBase = 1400; -const TInt KNSmlDsHTTPErrCodeRangeFirst = 1800; -const TInt KNSmlDsHTTPErrCodeRangeLast = 1905; +const TInt KNSmlDsErrCodeFirst = 400; +const TInt KNSmlDsErrCodeLast = 516; // ============================ MEMBER FUNCTIONS =============================== @@ -135,6 +135,7 @@ { InitializeServerStatusCodeList(); } + TRAP_IGNORE( iErrorReportingRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); DBG_FILE(_S8("CNSmlDSAgent::ConstructL ends")); } @@ -184,6 +185,11 @@ { delete iRepositorySSC; } + + if(iErrorReportingRep) + { + delete iErrorReportingRep; + } FeatureManager::UnInitializeLib(); } @@ -1684,15 +1690,11 @@ EDataSyncRunning12 ); } - CRepository* rep = NULL; - TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); - if ( err == KErrNone ) + if ( iErrorReportingRep ) { - rep->Set( KNsmlOpDsErrorCode, KErrNone ); - rep->Set( KNsmlOpDsSyncProfUid, profile->IntValue( EDSProfileId ) ); - rep->Set( KNsmlOpDsSyncInitiation, iSyncInitiation ); - - delete rep; + iErrorReportingRep->Set( KNsmlOpDsErrorCode, KErrNone ); + iErrorReportingRep->Set( KNsmlOpDsSyncProfUid, profile->IntValue( EDSProfileId ) ); + iErrorReportingRep->Set( KNsmlOpDsSyncInitiation, iSyncInitiation ); } TBool ifInternet = ETrue ; // CR: 403-1188 @@ -2939,12 +2941,9 @@ // Set sync stopped to P&S RProperty::Set( KPSUidDataSynchronizationInternalKeys, KDataSyncStatus, EDataSyncNotRunning ); - CRepository* rep = NULL; - TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); - if ( err == KErrNone ) + if ( iErrorReportingRep ) { - rep->Set( KNsmlOpDsSyncInitiation, EDataSyncNotRunning ); - delete rep; + iErrorReportingRep->Set( KNsmlOpDsSyncInitiation, EDataSyncNotRunning ); } ResetDSSessionInfoL(); @@ -3111,15 +3110,10 @@ } // Store status code to cenrep in case of error - if ( error ) + if ( error && iErrorReportingRep + && ( status >= KNSmlDsErrCodeFirst && status <= KNSmlDsErrCodeLast ) ) { - CRepository* rep = NULL; - TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); - if ( err == KErrNone ) - { - rep->Set( KNsmlOpDsErrorCode, status ); - delete rep; - } + iErrorReportingRep->Set( KNsmlOpDsErrorCode, status ); } if ( cmd == KNSmlAgentSyncHdr ) @@ -3459,20 +3453,20 @@ DBG_FILE(_S8("CNSmlDSAgent::FinaliseWhenErrorL begins")); // Store error code to cenrep - CRepository* rep = NULL; - TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); - if ( err == KErrNone ) + if ( iErrorReportingRep ) { - TInt errCode = iError->SyncLogErrorCode(); + TInt errCode = iError->SyncLogErrorCode(); - if ( errCode >= KNSmlDsHTTPErrCodeRangeFirst && - errCode <= KNSmlDsHTTPErrCodeRangeLast ) - { - errCode -= KNSmlDsHTTPErrCodeBase; - } + if ( errCode >= ( KNSmlDsHTTPErrCodeBase + KNSmlDsErrCodeFirst ) && + errCode <= ( KNSmlDsHTTPErrCodeBase + KNSmlDsErrCodeLast ) ) + { + errCode -= KNSmlDsHTTPErrCodeBase; + } - rep->Set( KNsmlOpDsErrorCode, errCode ); - delete rep; + if ( errCode >= KNSmlDsErrCodeFirst && errCode <= KNSmlDsErrCodeLast ) + { + iErrorReportingRep->Set( KNsmlOpDsErrorCode, errCode ); + } } // diff -r 915074efc433 -r 2de6635c154b syncmlfw/ds/syncagent/src/nsmldscmds.cpp --- a/syncmlfw/ds/syncagent/src/nsmldscmds.cpp Tue May 11 16:59:53 2010 +0300 +++ b/syncmlfw/ds/syncagent/src/nsmldscmds.cpp Tue May 25 13:36:17 2010 +0300 @@ -52,6 +52,7 @@ #include "nsmldsbatchbuffer.h" #include "nsmldshostclient.h" #include "nsmloperatordefines.h" +#include "NsmlOperatorErrorCRKeys.h" #ifndef __WINS__ // This lowers the unnecessary compiler warning (armv5) to remark. @@ -1712,9 +1713,7 @@ } } } - CNSmlDSSettings* settings = CNSmlDSSettings::NewLC(); - settings->StoreSyncType( alertCode ); - CleanupStack::PopAndDestroy( settings ); + StoreSyncType( alertCode ); } // status 406 is returned if is present BUT the session continues @@ -4812,4 +4811,50 @@ } } +//----------------------------------------------------------------------------- +// CNSmlDSCmds::StoreSyncType +// Checks if received Alert Code is a sync type and tries to convert +// it to Sync Type (TSmlSyncType). +//----------------------------------------------------------------------------- +// +void CNSmlDSCmds::StoreSyncType( const TDes8& aAlertCode ) + { + TInt syncType = KErrNotFound; + + if ( aAlertCode == KNSmlDSTwoWay ) + { + syncType = ESmlTwoWay; + } + else if ( aAlertCode == KNSmlDSOneWayFromServer ) + { + syncType = ESmlOneWayFromServer; + } + else if ( aAlertCode == KNSmlDSOneWayFromClient ) + { + syncType = ESmlOneWayFromClient; + } + else if ( aAlertCode == KNSmlDSSlowSync ) + { + syncType = ESmlSlowSync; + } + else if ( aAlertCode == KNSmlDSRefreshFromServer ) + { + syncType = ESmlRefreshFromServer; + } + else if ( aAlertCode == KNSmlDSRefreshFromClient ) + { + syncType = ESmlRefreshFromClient; + } + + if ( syncType != KErrNotFound ) + { + CRepository* rep = NULL; + TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) ); + if ( err == KErrNone ) + { + rep->Set( KNsmlOpDsSyncType, syncType ); + delete rep; + } + } + } // End of File diff -r 915074efc433 -r 2de6635c154b terminalsecurity/SCP/SCPServer/src/SCPServer.cpp --- a/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp Tue May 11 16:59:53 2010 +0300 +++ b/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp Tue May 25 13:36:17 2010 +0300 @@ -52,6 +52,21 @@ // For Device encryption #include #include +#include +/* +#ifdef _DEBUG +#define __SCP_DEBUG +#endif // _DEBUG + +// Define this so the precompiler in CW 3.1 won't complain about token pasting, +// the warnings are not valid +#pragma warn_illtokenpasting off + +#ifdef __SCP_DEBUG +#define Dprint(a) RDebug::Print##a +#else +#define Dprint(a) +#endif // _DEBUG*/ // ==================== LOCAL FUNCTIONS ==================== @@ -654,6 +669,12 @@ void CSCPServer::ValidateConfigurationL( TInt aMode ) { Dprint( (_L("--> CSCPServer::ValidateConfigurationL()") )); + RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()")); + TInt startupReason(ENormalStartup); + RProperty::Get(KPSUidStartup, KPSStartupReason, startupReason); + Dprint( (_L("CSCPServer::ValidateConfigurationL(): startupReason = %d"), startupReason)); + if((startupReason == ENormalRFSReset)||(startupReason == EDeepRFSReset)||(startupReason == EFirmwareUpdate)||(iConfiguration.iConfigFlag == KSCPConfigUnknown)) + { RMobilePhone::TMobilePassword storedCode; storedCode.Zero(); @@ -793,7 +814,7 @@ } User::LeaveIfError( err ); - + } Dprint( (_L("<-- CSCPServer::ValidateConfigurationL()") )); }