syncmlfw/common/http/src/nsmlhttpclient.cpp
changeset 60 eb6690d0d439
parent 22 19fb38abab1d
equal deleted inserted replaced
55:1c556dee8eb1 60:eb6690d0d439
    17 
    17 
    18 
    18 
    19 #include "nsmlhttpclient.h"
    19 #include "nsmlhttpclient.h"
    20 #include "nsmlerror.h"
    20 #include "nsmlerror.h"
    21 #include <featmgr.h>
    21 #include <featmgr.h>
       
    22 #include <nsmloperatorerrorcrkeys.h>
       
    23 #include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys
       
    24 #include <centralrepository.h> 
       
    25 
       
    26 //CONSTANTS
       
    27 const TInt KErrorCodeRangeFirst = 400;
       
    28 const TInt KErrorCodeRangeLast = 516;
    22 
    29 
    23 //Fix to Remove the Bad Compiler Warnings
    30 //Fix to Remove the Bad Compiler Warnings
    24 #ifndef __WINS__
    31 #ifndef __WINS__
    25 // This lowers the unnecessary compiler warning (armv5) to remark.
    32 // This lowers the unnecessary compiler warning (armv5) to remark.
    26 // "Warning:  #174-D: expression has no effect..." is caused by 
    33 // "Warning:  #174-D: expression has no effect..." is caused by 
    46 //------------------------------------------------------------
    53 //------------------------------------------------------------
    47 void CHttpEventHandler::ConstructL( CNSmlHTTP* aAgent )
    54 void CHttpEventHandler::ConstructL( CNSmlHTTP* aAgent )
    48 	{
    55 	{
    49 	FeatureManager::InitializeLibL();
    56 	FeatureManager::InitializeLibL();
    50 	iAgent = aAgent;
    57 	iAgent = aAgent;
       
    58  
       
    59     CRepository* rep = NULL;
       
    60     rep = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys );
       
    61     CleanupStack::PushL( rep );
       
    62     rep->Get( KNsmlOpDsHttpErrorReporting, iErrorReportingEnabled );
       
    63     CleanupStack::PopAndDestroy( rep );
       
    64  
       
    65     iRepositorySSC = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
    51 	}
    66 	}
    52 //------------------------------------------------------------
    67 //------------------------------------------------------------
    53 // CHttpEventHandler::~CHttpEventHandler()
    68 // CHttpEventHandler::~CHttpEventHandler()
    54 // destructor
    69 // destructor
    55 //------------------------------------------------------------
    70 //------------------------------------------------------------
    56 CHttpEventHandler::~CHttpEventHandler()
    71 CHttpEventHandler::~CHttpEventHandler()
    57 	{
    72 	{
    58 		FeatureManager::UnInitializeLib();
    73     FeatureManager::UnInitializeLib();		
       
    74     delete iRepositorySSC;
    59 	}
    75 	}
    60 //------------------------------------------------------------
    76 //------------------------------------------------------------
    61 // CHttpEventHandler::NewLC()
    77 // CHttpEventHandler::NewLC()
    62 //
    78 //
    63 //------------------------------------------------------------
    79 //------------------------------------------------------------
   121 			DBG_ARGS8(_S8("CHttpEventHandler::MHFRunL() contentTypeStr: %S"), &contentTypeStr );
   137 			DBG_ARGS8(_S8("CHttpEventHandler::MHFRunL() contentTypeStr: %S"), &contentTypeStr );
   122 			
   138 			
   123 			if ( contentTypeStr != KSmlContentTypeDS 
   139 			if ( contentTypeStr != KSmlContentTypeDS 
   124 				&& contentTypeStr != KSmlContentTypeDM )
   140 				&& contentTypeStr != KSmlContentTypeDM )
   125 				{
   141 				{
       
   142                 if( this->iAgent->iSession == ESyncMLDSSession )
       
   143                     {
       
   144                     if( iErrorReportingEnabled && ( ( status >= KErrorCodeRangeFirst ) 
       
   145                             && ( status <= KErrorCodeRangeLast ) ) )
       
   146                         {
       
   147                         iRepositorySSC->Set( KNsmlOpDsSyncErrorCode, status );
       
   148                         }
       
   149                     }  
       
   150 
   126 				//Error fix for BPSS-7H7H5S				
   151 				//Error fix for BPSS-7H7H5S				
   127 				DBG_FILE( _S8("CHttpEventHandler::MHFRunL() There is a mismatch in the Content Type") );
   152 				DBG_FILE( _S8("CHttpEventHandler::MHFRunL() There is a mismatch in the Content Type") );
   128 				
   153 				
   129 				status = CNSmlHTTP::SetErrorStatus( status );
   154 				status = CNSmlHTTP::SetErrorStatus( status );
   130 				
   155