omadrm/drmplugins/drmrohandler/src/rohandlerdmgrwrapper.cpp
changeset 49 69d8e75812b7
parent 29 3bdc3b853094
child 69 5ce76b969369
equal deleted inserted replaced
48:c68061d56109 49:69d8e75812b7
    30 #include <driveinfo.h>
    30 #include <driveinfo.h>
    31 #endif
    31 #endif
    32 
    32 
    33 #include <data_caging_path_literals.hrh>
    33 #include <data_caging_path_literals.hrh>
    34 
    34 
    35 #include <DownloadMgrClient.h>
       
    36 
       
    37 #include <es_enum.h> // tconnectioninfo
    35 #include <es_enum.h> // tconnectioninfo
    38 #include <es_sock.h> // rconnection rsocket
    36 #include <es_sock.h> // rconnection rsocket
    39 #include <RoapEng.h>
    37 #include <RoapEng.h>
    40 #include <RoapDef.h>
    38 #include <RoapDef.h>
    41 #include <RoapObserver.h>
    39 #include <RoapObserver.h>
    42 #include "RoapSyncWrapper.h"
    40 #include "RoapSyncWrapper.h"
    43 
    41 
       
    42 // Download manager apis
       
    43 #include <qobject.h>
       
    44 #include <downloadmanager.h>
       
    45 #include <download.h>
       
    46 
    44 #include "rohandlerdmgrwrapper.h"
    47 #include "rohandlerdmgrwrapper.h"
    45 #include "cleanupresetanddestroy.h"
    48 #include "cleanupresetanddestroy.h"
    46 #include "buffercontainers.h"
    49 #include "buffercontainers.h"
       
    50 #include "qrohandlerdmgreventhandler.h"
    47 
    51 
    48 #ifdef _DEBUG
    52 #ifdef _DEBUG
    49 #define DRMDEBUG( a ) RDebug::Print( a )
    53 #define DRMDEBUG( a ) RDebug::Print( a )
    50 #define DRMDEBUG2( a, b ) RDebug::Print( a, b )
    54 #define DRMDEBUG2( a, b ) RDebug::Print( a, b )
    51 #define DRMDEBUG3( a, b, c ) RDebug::Print( a, b, c )
    55 #define DRMDEBUG3( a, b, c ) RDebug::Print( a, b, c )
   108     _LIT( KStrEHttpDlCompleted, "EHttpDlCompleted" );
   112     _LIT( KStrEHttpDlCompleted, "EHttpDlCompleted" );
   109     _LIT( KStrEHttpDlFailed, "EHttpDlFailed" );
   113     _LIT( KStrEHttpDlFailed, "EHttpDlFailed" );
   110     _LIT( KStrEConnectionFailed, "EConnectionFailed" );
   114     _LIT( KStrEConnectionFailed, "EConnectionFailed" );
   111     _LIT( KFormatEDlAttrErrorId, "EDlAttrErrorId = %d" );
   115     _LIT( KFormatEDlAttrErrorId, "EDlAttrErrorId = %d" );
   112 
   116 
   113     _LIT( KMiDownLoadState, "iDownLoadState" );
   117     _LIT( KMiState, "iState" );
   114     _LIT( KMiProgressState, "iProgressState" );
       
   115 
   118 
   116     }
   119     }
   117 
   120 
   118 #else
   121 #else
   119 #define DRMDEBUG( a )
   122 #define DRMDEBUG( a )
   132 // CONSTANTS
   135 // CONSTANTS
   133 #ifndef RD_MULTIPLE_DRIVE
   136 #ifndef RD_MULTIPLE_DRIVE
   134 _LIT( KHelperTriggerFilePath, "d:\\" );
   137 _LIT( KHelperTriggerFilePath, "d:\\" );
   135 #endif
   138 #endif
   136 
   139 
   137 // ============================== LOCAL FUNCTIONS ==============================
   140 using namespace WRT;
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // DeleteHttpDowload
       
   141 // ---------------------------------------------------------------------------
       
   142 //
       
   143 LOCAL_C void DeleteHttpDowload( TAny* aDownload )
       
   144     {
       
   145     reinterpret_cast< RHttpDownload* >( aDownload )->Delete();
       
   146     }
       
   147 
   141 
   148 // ---------------------------------------------------------------------------
   142 // ---------------------------------------------------------------------------
   149 // UpdateBufferL
   143 // UpdateBufferL
   150 // ---------------------------------------------------------------------------
   144 // ---------------------------------------------------------------------------
   151 //
   145 //
   183 void CRoHandlerDMgrWrapper::ConstructL()
   177 void CRoHandlerDMgrWrapper::ConstructL()
   184     {
   178     {
   185     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethConstructL() );
   179     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethConstructL() );
   186     // Get UID from process
   180     // Get UID from process
   187     const TInt KRoHandlerDMgrWrapperUid = 0x101F7B92;
   181     const TInt KRoHandlerDMgrWrapperUid = 0x101F7B92;
   188     iDlMgr.ConnectL( TUid::Uid( KRoHandlerDMgrWrapperUid ), *this, EFalse );
   182     try
       
   183 		{
       
   184 		QString roHandlerDmgrWrapperUid(QString::number(KRoHandlerDMgrWrapperUid));
       
   185 		iDlMgr = q_check_ptr(new DownloadManager(roHandlerDmgrWrapperUid));
       
   186 		}
       
   187     catch(const std::exception& exception)
       
   188     	{
       
   189 		qt_symbian_exception2LeaveL(exception);
       
   190     	}
   189     User::LeaveIfError( iFs.Connect() );
   191     User::LeaveIfError( iFs.Connect() );
   190     User::LeaveIfError( iFs.ShareProtected() );
   192     User::LeaveIfError( iFs.ShareProtected() );
   191 
   193 
   192     }
   194     }
   193 
   195 
   228     delete iTriggerUrl;
   230     delete iTriggerUrl;
   229     delete iTriggerBuf;
   231     delete iTriggerBuf;
   230     delete iFileName;
   232     delete iFileName;
   231     delete iRoapEng;
   233     delete iRoapEng;
   232 
   234 
   233 #ifdef _DEBUG
   235     delete iDlMgr;
   234 
   236     delete iRoHandlerDMgrEventHandler;
   235     if ( iDlMgr.Handle() )
   237     
   236         {
       
   237         iDlMgr.Close();
       
   238         }
       
   239 
       
   240 #else
       
   241 
       
   242     iDlMgr.Close();
       
   243 
       
   244 #endif
       
   245 
       
   246     iFs.Close();
   238     iFs.Close();
       
   239     
   247     }
   240     }
   248 
   241 
   249 // ---------------------------------------------------------------------------
   242 // ---------------------------------------------------------------------------
   250 // CRoHandlerDMgrWrapper::HandleRoapTriggerL
   243 // CRoHandlerDMgrWrapper::HandleRoapTriggerL
   251 // ---------------------------------------------------------------------------
   244 // ---------------------------------------------------------------------------
   267 // ---------------------------------------------------------------------------
   260 // ---------------------------------------------------------------------------
   268 //
   261 //
   269 void CRoHandlerDMgrWrapper::DoDownloadRoapTriggerL( TMeterState aNextState )
   262 void CRoHandlerDMgrWrapper::DoDownloadRoapTriggerL( TMeterState aNextState )
   270     {
   263     {
   271     RFile roapTrigger;
   264     RFile roapTrigger;
   272     TBool result( EFalse );
       
   273     DRM::CFileNameContainer* triggerFileName(NULL);
   265     DRM::CFileNameContainer* triggerFileName(NULL);
   274 
   266 
   275     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethDoDownloadAndHandleRoapTriggerL() );
   267     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethDoDownloadAndHandleRoapTriggerL() );
   276     // If no Trigger URL then nothing to download. So finish transaction
   268     // If no Trigger URL then nothing to download. So finish transaction
   277     if ( !iTriggerUrl || iTriggerUrl->Length() <= 0 )
   269     if ( !iTriggerUrl || iTriggerUrl->Length() <= 0 )
   306 #endif
   298 #endif
   307     UpdateBufferL< HBufC, TFileName >( iFileName, triggerFileName->iBuffer );
   299     UpdateBufferL< HBufC, TFileName >( iFileName, triggerFileName->iBuffer );
   308     CleanupStack::PopAndDestroy( triggerFileName );
   300     CleanupStack::PopAndDestroy( triggerFileName );
   309     triggerFileName=NULL;
   301     triggerFileName=NULL;
   310 
   302 
   311     // create and start download
   303     try
   312     RHttpDownload& download = iDlMgr.CreateDownloadL( *iTriggerUrl, result );
   304 		{
   313     // Put download for proper cleanup.
   305 		// create and start download
   314     TCleanupItem item( DeleteHttpDowload, &download );
   306         QString downloadUrl((QChar*)iTriggerUrl->Des().Ptr(),iTriggerUrl->Length());
   315     CleanupStack::PushL( item );
   307         iDownload = iDlMgr->createDownload( downloadUrl );
   316 
   308 		iRoHandlerDMgrEventHandler = q_check_ptr(new QRoHandlerDMgrEventHandler(*this, *iDownload));
       
   309 		}
       
   310     catch(const std::exception& exception)
       
   311 		{
       
   312 		qt_symbian_exception2LeaveL(exception);
       
   313 		}
       
   314     		
   317     CleanupClosePushL( roapTrigger );
   315     CleanupClosePushL( roapTrigger );
   318 
   316 
   319     if ( result )
   317     
   320         {
   318 	DRMDEBUG2(
   321         DRMDEBUG2(
   319 		RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
   322             RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
   320 		&RoHdlrDMgrWrDebugLiterals::KStrDlCreated() );
   323             &RoHdlrDMgrWrDebugLiterals::KStrDlCreated() );
   321 	iDownloadSuccess = EFalse;
   324         iDownloadSuccess = EFalse;
   322 	iConnectionError = EFalse;
   325         iConnectionError = EFalse;
   323 
   326 
   324 	SetDefaultAccessPointL();
   327         SetDefaultAccessPointL();
   325         
   328         User::LeaveIfError( download.SetFileHandleAttribute( roapTrigger ) );
   326 	try
   329         User::LeaveIfError( download.SetBoolAttribute(
   327 		{
   330                 EDlAttrNoContentTypeCheck, ETrue ) );
   328 		RBuf fileName;
   331         User::LeaveIfError( download.Start() );
   329 		fileName.Create(KMaxFileName);
   332 
   330 		CleanupClosePushL(fileName);
   333         // wait until download is finished
   331 		roapTrigger.Name(fileName);
   334         iState = aNextState;
   332 		const QVariant& roapTriggerValue( QString((QChar*) fileName.Ptr(), fileName.Length()) );
   335         TRequestStatus* status( &iStatus );
   333 		CleanupStack::PopAndDestroy(&fileName);
   336         *status = KRequestPending;
   334 		iDownload->setAttribute(FileName,roapTriggerValue);
   337         SetActive();
   335 		const QVariant& val(ETrue);
   338         }
   336 		iDownload->setAttribute(ContentType, val);
       
   337 		iDownload->start();
       
   338 		}
       
   339 	catch(const std::exception& exception)
       
   340 		{
       
   341 		qt_symbian_exception2LeaveL(exception);
       
   342 		}
       
   343 	
       
   344 	// wait until download is finished
       
   345 	iState = aNextState;
       
   346 	TRequestStatus* status( &iStatus );
       
   347 	*status = KRequestPending;
       
   348 	SetActive();
       
   349         
   339     CleanupStack::PopAndDestroy( &roapTrigger );
   350     CleanupStack::PopAndDestroy( &roapTrigger );
   340     CleanupStack::Pop( &download ); // Left open for DoSaveRoapTrigger
       
   341     }
   351     }
   342 // ---------------------------------------------------------------------------
   352 // ---------------------------------------------------------------------------
   343 // CRoHandlerDMgrWrapper::DoSaveRoapTriggerL
   353 // CRoHandlerDMgrWrapper::DoSaveRoapTriggerL
   344 // ---------------------------------------------------------------------------
   354 // ---------------------------------------------------------------------------
   345 //
   355 //
   348     // Check success of download
   358     // Check success of download
   349     DRMDEBUG2(
   359     DRMDEBUG2(
   350         RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
   360         RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
   351         &RoHdlrDMgrWrDebugLiterals::KStrDlFinished() );
   361         &RoHdlrDMgrWrDebugLiterals::KStrDlFinished() );
   352 
   362 
   353     // Fetch download created in DoDownloadRoapTriggerL
   363     try
   354     RHttpDownload* download = iDlMgr.FindDownload( *iTriggerUrl, KNullDesC8() );
   364 		{
       
   365 		// Fetch download created in DoDownloadRoapTriggerL
       
   366 		QString downloadUrl((QChar*)iTriggerUrl->Des().Ptr(),iTriggerUrl->Length());
       
   367 		//uncomment
       
   368 		iDownload = NULL; //iDlMgr->findDownload( downloadUrl );
       
   369 		}
       
   370     catch(const std::exception& exception)
       
   371 		{
       
   372 		qt_symbian_exception2LeaveL(exception);
       
   373 		} 
       
   374     
   355     // Delete trigger URL so that it is possible to check
   375     // Delete trigger URL so that it is possible to check
   356     // whether or not meteringResponse has PrUrl.
   376     // whether or not meteringResponse has PrUrl.
   357     delete iTriggerUrl;
   377     delete iTriggerUrl;
   358     iTriggerUrl = NULL;
   378     iTriggerUrl = NULL;
   359     // Put download for proper cleanup.
   379     
   360     TCleanupItem item( DeleteHttpDowload, download );
       
   361     CleanupStack::PushL( item );
       
   362     RFile roapTrigger;
   380     RFile roapTrigger;
   363 
   381 
   364     if ( !iDownloadSuccess )
   382     if ( !iDownloadSuccess )
   365         {
   383         {
   366             if ( iConnectionError )
   384             if ( iConnectionError )
   399         }
   417         }
   400 
   418 
   401     // And let ROAP handle it...
   419     // And let ROAP handle it...
   402     CleanupStack::PopAndDestroy( &readBuf );
   420     CleanupStack::PopAndDestroy( &readBuf );
   403     CleanupStack::PopAndDestroy( &roapTrigger );
   421     CleanupStack::PopAndDestroy( &roapTrigger );
   404     CleanupStack::PopAndDestroy( download );
   422     
   405 
       
   406     iFs.Delete( *iFileName );
   423     iFs.Delete( *iFileName );
   407     delete iFileName;
   424     delete iFileName;
   408     iFileName=NULL;
   425     iFileName=NULL;
   409     Continue( aNextState, KErrNone );
   426     Continue( aNextState, KErrNone );
   410     }
   427     }
   451     {
   468     {
   452     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethSetDefaultAccessPointL() );
   469     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethSetDefaultAccessPointL() );
   453 
   470 
   454     if ( iIapId )
   471     if ( iIapId )
   455         {
   472         {
   456         iDlMgr.SetIntAttribute( EDlMgrIap, iIapId );
   473         QVariant iapId((unsigned long long)iIapId);
       
   474         iDlMgr->setAttribute(DefaultDestinationPath, iapId);
   457         }
   475         }
   458     }
   476     }
   459 
   477 
   460 // ---------------------------------------------------------------------------
   478 // ---------------------------------------------------------------------------
   461 // CRoHandlerDMgrWrapper::Continue
   479 // CRoHandlerDMgrWrapper::Continue
   476 
   494 
   477 // ---------------------------------------------------------------------------
   495 // ---------------------------------------------------------------------------
   478 // CRoHandlerDMgrWrapper::HandleDMgrEventL
   496 // CRoHandlerDMgrWrapper::HandleDMgrEventL
   479 // ---------------------------------------------------------------------------
   497 // ---------------------------------------------------------------------------
   480 //
   498 //
   481 void CRoHandlerDMgrWrapper::HandleDMgrEventL( RHttpDownload& aDownload,
   499 void CRoHandlerDMgrWrapper::HandleDownloadEventL( WRT::DownloadEvent* aEvent )
   482         THttpDownloadEvent aEvent )
   500     {
   483     {
   501     QString KDRMHelperMimeTypeROAPTrigger("application/vnd.oma.drm.roap-trigger+xml" );
   484     _LIT8( KDRMHelperMimeTypeROAPTrigger, "application/vnd.oma.drm.roap-trigger+xml" );
       
   485 
   502 
   486     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethHandleDMgrEventL() );
   503     DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethHandleDMgrEventL() );
   487     DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
   504     DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
   488             &RoHdlrDMgrWrDebugLiterals::KMiDownLoadState(), aEvent.iDownloadState );
   505             &RoHdlrDMgrWrDebugLiterals::KMiState(), aEvent->type() );
   489     DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
   506     
   490             &RoHdlrDMgrWrDebugLiterals::KMiProgressState(), aEvent.iProgressState );
   507     if ( aEvent->type() == DownloadEvent::HeadersReceived )
   491 
       
   492     if ( aEvent.iProgressState == EHttpContentTypeReceived )
       
   493         {
   508         {
   494         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   509         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   495                 &RoHdlrDMgrWrDebugLiterals::KStrEHttpContentTypeReceived() );
   510                 &RoHdlrDMgrWrDebugLiterals::KStrEHttpContentTypeReceived() );
   496         // check received mimetype
   511         // check received mimetype
   497         RBuf8 contentType;
   512         QString contentType = iDownload->attribute( ContentType).toString();
   498         contentType.CleanupClosePushL();
   513         if ( contentType.contains( KDRMHelperMimeTypeROAPTrigger )  == EFalse )
   499         contentType.CreateL( KMaxContentTypeLength );
       
   500         User::LeaveIfError( aDownload.GetStringAttribute( EDlAttrContentType,
       
   501                 contentType ) );
       
   502         if ( !contentType.FindF( KDRMHelperMimeTypeROAPTrigger ) )
       
   503             {
   514             {
   504             // ROAP trigger found, continue download
   515             // ROAP trigger found, continue download
   505             User::LeaveIfError( aDownload.Start() );
   516             iDownload->start();
   506             }
   517             }
   507         else
   518         else
   508             {
   519             {
   509             // wrong MIME type?, stop download
   520             // wrong MIME type?, stop download
   510             iDownloadSuccess = EFalse;
   521             iDownloadSuccess = EFalse;
   511             User::LeaveIfError( aDownload.Delete() );
   522             iDownload->cancel();
   512             }
   523             }
   513         CleanupStack::PopAndDestroy( &contentType );
   524         CleanupStack::PopAndDestroy( &contentType );
   514         }
   525         }
   515 
   526 
   516     if ( aEvent.iDownloadState == EHttpDlCreated )
   527     if ( aEvent->type() == DownloadEvent::Created )
   517         {
   528         {
   518         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   529         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   519                 &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCreated() );
   530                 &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCreated() );
   520         }
   531         }
   521     else
   532     else
   522         if ( aEvent.iProgressState == EHttpProgDisconnected )
   533         if ( aEvent->type() == DownloadEvent::NetworkLoss )
   523             {
   534             {
   524             DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   535             DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   525                     &RoHdlrDMgrWrDebugLiterals::KStrEHttpProgDisconnected() );
   536                     &RoHdlrDMgrWrDebugLiterals::KStrEHttpProgDisconnected() );
   526             // store failure
   537             // store failure
   527             iDownloadSuccess = EFalse;
   538             iDownloadSuccess = EFalse;
   528             iConnectionError = ETrue;
   539             iConnectionError = ETrue;
   529             // finished
   540             // finished
   530             TRequestStatus* status( &iStatus );
   541             TRequestStatus* status( &iStatus );
   531             User::RequestComplete( status, KErrCancel );
   542             User::RequestComplete( status, KErrCancel );
   532             }
   543             }
   533         else
   544 	else
   534             if ( aEvent.iDownloadState == EHttpDlInprogress )
   545 		if ( aEvent->type() == DownloadEvent::InProgress )
   535                 {
   546 			{
   536                 DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   547 			DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   537                         &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlInprogress() );
   548 					&RoHdlrDMgrWrDebugLiterals::KStrEHttpDlInprogress() );
   538                 }
   549 			}
   539             else
   550 	else
   540                 if ( aEvent.iDownloadState == EHttpDlCompleted )
   551 		if ( aEvent->type() == DownloadEvent::Completed )
   541                     {
   552 			{
   542                     // store success
   553 			// store success
   543                     DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   554 			DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   544                             &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCompleted() );
   555 					&RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCompleted() );
   545                     iDownloadSuccess = ETrue;
   556 			iDownloadSuccess = ETrue;
   546 
   557 
   547                     // finished
   558 			// finished
   548                     TRequestStatus* status( &iStatus );
   559 			TRequestStatus* status( &iStatus );
   549                     User::RequestComplete( status, KErrNone );
   560 			User::RequestComplete( status, KErrNone );
   550                     }
   561 			}
   551                 else
   562 	else
   552                     if ( aEvent.iDownloadState == EHttpDlFailed )
   563 		if ( aEvent->type() == DownloadEvent::Failed )
   553                         {
   564 			{
   554                         TInt32 err;
   565 			TInt32 err;
   555 
   566 
   556                         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   567 			DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   557                                 &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlFailed() );
   568 					&RoHdlrDMgrWrDebugLiterals::KStrEHttpDlFailed() );
   558                         // store failure
   569 			// store failure
   559                         iDownloadSuccess = EFalse;
   570 			iDownloadSuccess = EFalse;
   560                         User::LeaveIfError( aDownload.GetIntAttribute(
   571 			err = iDownload->attribute(LastError ).toInt();
   561                                 EDlAttrErrorId, err ) );
   572 			DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatEDlAttrErrorId(), err );
   562                         DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatEDlAttrErrorId(), err );
   573 
   563 
   574 			if ( err == ConnectionFailed || err == TransactionFailed )
   564                         if ( err == EConnectionFailed || err
   575 				{
   565                                 == ETransactionFailed )
   576 				DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   566                             {
   577 						&RoHdlrDMgrWrDebugLiterals::KStrEConnectionFailed() );
   567                             DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
   578 				iConnectionError = ETrue;
   568                                     &RoHdlrDMgrWrDebugLiterals::KStrEConnectionFailed() );
   579 				}
   569                             iConnectionError = ETrue;
   580 
   570                             }
   581 			// finished
   571 
   582 			TRequestStatus* status( &iStatus );
   572                         // finished
   583 			User::RequestComplete( status, KErrCancel );
   573                         TRequestStatus* status( &iStatus );
   584 			}
   574                         User::RequestComplete( status, KErrCancel );
       
   575                         }
       
   576     }
   585     }
   577 
   586 
   578 
   587 
   579 // RoapObserver methods
   588 // RoapObserver methods
   580 
   589 
   749         {
   758         {
   750         iWait.AsyncStop();
   759         iWait.AsyncStop();
   751         }
   760         }
   752     return KErrNone;
   761     return KErrNone;
   753     }
   762     }
       
   763