ncdengine/engine/transport/src/catalogshttpdownload.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 11 3ba40be8e484
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
    21 #include <bautils.h>
    21 #include <bautils.h>
    22 #include <e32err.h>
    22 #include <e32err.h>
    23 #include <DocumentHandler.h>
    23 #include <DocumentHandler.h>
    24 #include <apmstd.h> // TDataType
    24 #include <apmstd.h> // TDataType
    25 #include <escapeutils.h>
    25 #include <escapeutils.h>
       
    26 #include <downloadmanager.h>
       
    27 #include <cmmanager.h>
       
    28 #include <cmdestination.h>
       
    29 #include <uri8.h> 
       
    30 #include <QtGlobal>
       
    31 #include <QStringList>
       
    32 #include <xqconversions.h>
    26 
    33 
    27 #include "catalogshttpdownloadmanagerimpl.h"
    34 #include "catalogshttpdownloadmanagerimpl.h"
    28 #include "catalogshttpobserver.h"
    35 #include "catalogshttpobserver.h"
    29 #include "catalogshttpconfigimpl.h"
    36 #include "catalogshttpconfigimpl.h"
    30 #include "catalogskeyvaluepair.h"
    37 #include "catalogskeyvaluepair.h"
    93 // Creator
   100 // Creator
    94 // ---------------------------------------------------------------------------
   101 // ---------------------------------------------------------------------------
    95 //	
   102 //	
    96 CCatalogsHttpDownload* CCatalogsHttpDownload::NewLC( 
   103 CCatalogsHttpDownload* CCatalogsHttpDownload::NewLC( 
    97     CCatalogsHttpDownloadManager& aOwner, 
   104     CCatalogsHttpDownloadManager& aOwner, 
    98     RHttpDownload* aDownload,
   105     Download* aDownload,
    99     const CCatalogsHttpConfig& aConfig )
   106     const CCatalogsHttpConfig& aConfig )
   100     {
   107     {
   101     CCatalogsHttpDownload* self = new( ELeave ) CCatalogsHttpDownload( 
   108     CCatalogsHttpDownload* self = new( ELeave ) CCatalogsHttpDownload( 
   102         aOwner,
   109         aOwner,
   103         aDownload );
   110         aDownload );
   138             SetDeleteState( EDownloadPaused );
   145             SetDeleteState( EDownloadPaused );
   139             }
   146             }
   140         else 
   147         else 
   141             {
   148             {
   142             DLTRACE(( "Deleting download" ));
   149             DLTRACE(( "Deleting download" ));
   143             iDownload->Delete();                        
   150              iOwner.GetDownloadManager()->removeOne(iDownload);                      
   144             
   151             
   145             if ( iState.iOperationState != ECatalogsHttpOpCompleted ) 
   152             if ( iState.iOperationState != ECatalogsHttpOpCompleted ) 
   146                 {
   153                 {
   147                 // Ensure that temp files are really deleted
   154                 // Ensure that temp files are really deleted
   148                 DeleteFiles();
   155                 DeleteFiles();
   242     iCancelled = ETrue;
   249     iCancelled = ETrue;
   243     if ( iDownload )
   250     if ( iDownload )
   244         {
   251         {
   245         iObserver = NULL;
   252         iObserver = NULL;
   246         TInt32 state = 0;
   253         TInt32 state = 0;
   247         iDownload->GetIntAttribute( EDlAttrState, state );
   254 
   248         
   255          state = (Download::State)iDownload->attribute(State).toInt();
   249         if ( IsOneOf( 
   256         if ( IsOneOf( 
   250                 static_cast<THttpDownloadState>( state ), 
   257                 static_cast<THttpDownloadState>( state ), 
   251                 EHttpDlCreated,
   258                 EHttpDlCreated,
   252                 EHttpDlPaused,
   259                 EHttpDlPaused,
   253                 EHttpDlCompleted,
   260                 EHttpDlCompleted,
   471         // just restarted when it's resumed
   478         // just restarted when it's resumed
   472         DLTRACE(("Thread semaphore count: %d", RThread().RequestCount() ));
   479         DLTRACE(("Thread semaphore count: %d", RThread().RequestCount() ));
   473         TInt err = KErrNone;
   480         TInt err = KErrNone;
   474         if ( iDownload ) 
   481         if ( iDownload ) 
   475             {
   482             {
   476             err = iDownload->Pause();
   483 					    try
       
   484 							{
       
   485 							iDownload->pause();
       
   486 							}
       
   487 			        catch(const std::exception& exception)
       
   488 			        	{
       
   489 							 err = qt_symbian_exception2Error(exception);
       
   490 			        	}
   477             }
   491             }
   478         
   492         
   479         DLTRACE(("Pause err: %d", err ));
   493         DLTRACE(("Pause err: %d", err ));
   480         if ( err == KErrNone ) 
   494         if ( err == KErrNone ) 
   481             {
   495             {
   678     DLTRACEIN((""));
   692     DLTRACEIN((""));
   679     // We get the content size only once in order to minimize 
   693     // We get the content size only once in order to minimize 
   680     // client-server communication with the Download manager server
   694     // client-server communication with the Download manager server
   681     if ( iDownload && iContentSize <= 0 ) 
   695     if ( iDownload && iContentSize <= 0 ) 
   682         {                
   696         {                
   683         iDownload->GetIntAttribute( EDlAttrLength, iContentSize );    
   697         iContentSize = iDownload->attribute(TotalSize).toInt();
   684         DLTRACE(("Content size from download: %i", iContentSize ));
   698         DLTRACE(("Content size from download: %i", iContentSize ));
   685         }
   699         }
   686     return iContentSize;
   700     return iContentSize;
   687     }
   701     }
   688 
   702 
   704 TBool CCatalogsHttpDownload::IsPausable() const
   718 TBool CCatalogsHttpDownload::IsPausable() const
   705     {    
   719     {    
   706     TBool pausable = ETrue;
   720     TBool pausable = ETrue;
   707     if ( iDownload ) 
   721     if ( iDownload ) 
   708         {        
   722         {        
   709         iDownload->GetBoolAttribute( EDlAttrPausable, pausable );
   723 
       
   724         pausable=iDownload->attribute(Pausable).toBool();
   710         }
   725         }
   711     return pausable;
   726     return pausable;
   712     }
   727     }
   713 
   728 
   714 
   729 
   797     {
   812     {
   798     DLTRACEIN((""));
   813     DLTRACEIN((""));
   799     iConfig->InternalizeL( aStream );
   814     iConfig->InternalizeL( aStream );
   800     HBufC8* contentType = NULL;
   815     HBufC8* contentType = NULL;
   801     InternalizeDesL( contentType, aStream );
   816     InternalizeDesL( contentType, aStream );
   802     if ( contentType->Length() > KMaxContentTypeLength ) 
   817     // HLa if ( contentType->Length() > KMaxContentTypeLength ) 
       
   818     if ( contentType->Length() > 256 )
   803         {
   819         {
   804         DeletePtr( contentType );
   820         DeletePtr( contentType );
   805         DLERROR(("Content type was too long, leaving with KErrCorrupt"));
   821         DLERROR(("Content type was too long, leaving with KErrCorrupt"));
   806         User::Leave( KErrCorrupt );
   822         User::Leave( KErrCorrupt );
   807         }
   823         }
   837         return iOwner.OperationPriorityChanged( this );
   853         return iOwner.OperationPriorityChanged( this );
   838         }
   854         }
   839     return KErrNone;
   855     return KErrNone;
   840     }
   856     }
   841 
   857 
   842 
   858 void CCatalogsHttpDownload::HandledownloadEventL(DownloadEvent& aEvent)
       
   859 {
       
   860 	
       
   861 	switch(aEvent.type())
       
   862 	{
       
   863 		
       
   864 		case DownloadEvent::Started:
       
   865 		
       
   866 			break;
       
   867 		
       
   868 		case DownloadEvent::Error:	
       
   869 		case DownloadEvent::Failed:
       
   870 		case DownloadEvent::NetworkLoss:    
       
   871 		case DownloadEvent::ConnectionNeeded:  
       
   872 		case DownloadEvent::ConnectionDisconnected:    
       
   873 			{
       
   874 		    TInt32 errorId = -1;
       
   875 		    if ( aEvent.type() == DownloadEvent::NetworkLoss  || 
       
   876 		         aEvent.type() == DownloadEvent::ConnectionNeeded ||
       
   877 		         aEvent.type() == DownloadEvent::ConnectionDisconnected )
       
   878 		        {
       
   879 		        errorId = WRT::ConnectionFailed;
       
   880 		        }
       
   881             SetTransferring( EFalse );
       
   882             errorId = iDownload->attribute(LastError).toInt();
       
   883             if ( errorId > 0 )
       
   884                 {
       
   885                 // Symbian error codes are always negative numbers 
       
   886                 errorId =  -1 * errorId;
       
   887                 }
       
   888                                     
       
   889             /*if ( ( errorId == ConnectionFailed || 
       
   890                    errorId == TransactionFailed )) 
       
   891                 {
       
   892                 DLTRACE(("Try to reconnect"));
       
   893                 iReconnectWhenFail = EFalse;
       
   894                 iDownload->start();
       
   895                 break;
       
   896                 }
       
   897             else if ( errorId == ContentExpired ||
       
   898                       errorId == PartialContentModified )
       
   899                 {
       
   900                 DLTRACE(("Content has changed, reset and restart"));
       
   901                 iReconnectWhenFail = EFalse;
       
   902                 iDownload->cancel();
       
   903                 iDownload->start();
       
   904                 break;
       
   905                 }*/
       
   906             iState.iOperationState = ECatalogsHttpOpFailed;
       
   907             
       
   908             TBool deleted = EFalse;
       
   909             if ( iObserver ) 
       
   910                 {
       
   911                 // Determine whether failure was due to a HTTP error or some
       
   912                 // other error. 
       
   913                 //if ( errorId >= 400 ) 
       
   914                 //    {
       
   915                //     deleted = iObserver->HandleHttpError( 
       
   916                //     *this, TCatalogsHttpError(
       
   917               //      ECatalogsHttpErrorHttp, 
       
   918               //      errorId ) );
       
   919               //      }
       
   920               //  else 
       
   921                     {
       
   922                     AddRef();
       
   923                     //iOwner.ConnectionManager().ReportConnectionError( 
       
   924                     //               TCatalogsConnectionMethod(), errorId );
       
   925                                 
       
   926                     if ( iRefCount > 1 )
       
   927                         {                       
       
   928                         deleted = iObserver->HandleHttpError( 
       
   929                         *this, TCatalogsHttpError( 
       
   930                         ECatalogsHttpErrorGeneral, errorId ) );
       
   931                         }
       
   932                     else 
       
   933                         {
       
   934                         deleted = ETrue;
       
   935                         }
       
   936                     Release();
       
   937                     }
       
   938                 }
       
   939             if ( !deleted )
       
   940                 {                
       
   941                 iOwner.CompleteOperation( this );
       
   942                 iState.iProgressState = ECatalogsHttpDone;
       
   943                 }
       
   944 			}
       
   945 			break;
       
   946 		
       
   947 		case DownloadEvent::Cancelled:
       
   948 		
       
   949 			break;
       
   950 		case DownloadEvent::ContentTypeChanged:
       
   951 			
       
   952 			break;
       
   953 		case DownloadEvent::HeadersReceived:
       
   954 			{
       
   955 					// Read the response headers from platform DL manager
       
   956 			UpdateResponseHeadersL();		
       
   957 			UpdateContentType();
       
   958 		  }
       
   959 			break;
       
   960 	
       
   961 	  
       
   962 		case DownloadEvent::Completed:
       
   963 			  {            
       
   964             // move/rename temp file as the target file
       
   965             TRAPD( err, MoveFileL() );
       
   966             
       
   967             // DLMAIN-546, delete DL manager's download before starting
       
   968             // the next one so that downloads don't jam, again
       
   969             if ( iDownload ) 
       
   970                 {   
       
   971                 	iTransferredSize = iDownload->attribute(DownloadedSize).toInt();             
       
   972          
       
   973                     
       
   974                 DLTRACE(("Deleting download"));                
       
   975                 DeletePlatformDownload();                
       
   976                 }
       
   977             iState.iProgressState = ECatalogsHttpDone;
       
   978             iOwner.CompleteOperation( this );
       
   979             iState.iOperationState = ECatalogsHttpOpCompleted;
       
   980             
       
   981             if ( iObserver ) 
       
   982                 {                
       
   983                 iObserver->HandleHttpEventL( *this, iState );
       
   984                 }
       
   985 
       
   986 	     }
       
   987 			break;
       
   988 			
       
   989 		case DownloadEvent::InProgress:
       
   990 		    {
       
   991 		    iTransferredSize  =  iDownload->attribute(DownloadedSize).toInt();
       
   992 		    if ( iObserver ) 
       
   993 		        {                
       
   994 		        iObserver->HandleHttpEventL( *this, iState );
       
   995 		        }
       
   996 		    }
       
   997 		    break;
       
   998 		  
       
   999 	  default:
       
  1000             {
       
  1001             }		  
       
  1002 	};
       
  1003 }
   843 // ---------------------------------------------------------------------------
  1004 // ---------------------------------------------------------------------------
   844 // Handles events from the transaction
  1005 // Handles events from the transaction
   845 // ---------------------------------------------------------------------------
  1006 // ---------------------------------------------------------------------------
   846 //	
  1007 //	
   847 void CCatalogsHttpDownload::HandleHttpEventL( 
  1008 void CCatalogsHttpDownload::HandleHttpEventL( 
   989 
  1150 
   990 // ---------------------------------------------------------------------------
  1151 // ---------------------------------------------------------------------------
   991 // Handles events from the download manager
  1152 // Handles events from the download manager
   992 // ---------------------------------------------------------------------------
  1153 // ---------------------------------------------------------------------------
   993 //	
  1154 //	
       
  1155 
       
  1156 /* HLa
   994 void CCatalogsHttpDownload::HandleEventL( THttpDownloadEvent aEvent )
  1157 void CCatalogsHttpDownload::HandleEventL( THttpDownloadEvent aEvent )
   995     {
  1158     {
   996     DLTRACEIN((""));
  1159     DLTRACEIN((""));
   997     DLINFO( ("DL id: %d, Dl state: %i, Pr: %i, this-ptr: %X, iState: %d, iProgress: %d, dl-ptr: %X", 
  1160     DLINFO( ("DL id: %d, Dl state: %i, Pr: %i, this-ptr: %X, iState: %d, iProgress: %d, dl-ptr: %X", 
   998         OperationId().Id(),
  1161         OperationId().Id(),
  1023         return;
  1186         return;
  1024         }
  1187         }
  1025     
  1188     
  1026 	TInt32 statusCode = -1;
  1189 	TInt32 statusCode = -1;
  1027 	
  1190 	
  1028 	iDownload->GetIntAttribute( EDlAttrStatusCode, statusCode );
  1191 	 statusCode  = (Download::State)iDownload->attribute(WRT::State).toInt(); 
  1029 	DLINFO( ("Response status: %i", statusCode ) );
  1192 	 DLINFO( ("Response status: %i", statusCode ) );
  1030 
  1193 
  1031 #ifdef CATALOGS_BUILD_CONFIG_DEBUG    
  1194 #ifdef CATALOGS_BUILD_CONFIG_DEBUG    
  1032     TInt32 errorId = 0;
  1195     TInt32 errorId = 0;
  1033 
  1196 		errorId=iDownload->attribute(LastError).toInt();
  1034 	iDownload->GetIntAttribute( EDlAttrErrorId, errorId );
  1197 
  1035 	DLINFO( ("Error id: %i", errorId ) );
  1198 	DLINFO( ("Error id: %i", errorId ) );
  1036 	    
  1199 	    
  1037 #endif
  1200 #endif
  1038 
  1201 
  1039     TInt32 globalErrorId = 0;    
  1202     TInt32 globalErrorId = 0;    
  1040 	iDownload->GetIntAttribute( 
  1203    globalErrorId= iDownload->attribute(LastError).toInt();
  1041 	    EDlAttrGlobalErrorId, globalErrorId );
  1204 
  1042 	DLINFO( ("Global error id: %i", globalErrorId ) );
  1205 	DLINFO( ("Global error id: %i", globalErrorId ) );
  1043 	
  1206 	
  1044 
  1207 
  1045     // was >=, DL manager should give us proper errors but it doesn't always
  1208     // was >=, DL manager should give us proper errors but it doesn't always
  1046     if ( ( statusCode == KHttpErrorStatus ||
  1209     if ( ( statusCode == KHttpErrorStatus ||
  1083             if ( iReconnectWhenFail && 
  1246             if ( iReconnectWhenFail && 
  1084                  iState.iProgressState == ECatalogsHttpDisconnected ) 
  1247                  iState.iProgressState == ECatalogsHttpDisconnected ) 
  1085                 {
  1248                 {
  1086                 DLTRACE(("Try to reconnect"));
  1249                 DLTRACE(("Try to reconnect"));
  1087                 iReconnectWhenFail = EFalse;
  1250                 iReconnectWhenFail = EFalse;
  1088                 iDownload->Start();                
  1251                 iDownload->start();                
  1089                 break;
  1252                 break;
  1090                 }
  1253                 }
  1091             
  1254             
  1092             if ( iState.iOperationState != ECatalogsHttpOpQueued ) 
  1255             if ( iState.iOperationState != ECatalogsHttpOpQueued ) 
  1093                 {                
  1256                 {                
  1141             TRAPD( err, MoveFileL() );
  1304             TRAPD( err, MoveFileL() );
  1142             
  1305             
  1143             // DLMAIN-546, delete DL manager's download before starting
  1306             // DLMAIN-546, delete DL manager's download before starting
  1144             // the next one so that downloads don't jam, again
  1307             // the next one so that downloads don't jam, again
  1145             if ( iDownload ) 
  1308             if ( iDownload ) 
  1146                 {                
  1309                 {   
  1147                 iDownload->GetIntAttribute( 
  1310                 	iTransferredSize = iDownload->attribute(DownloadedSize).toInt();             
  1148                     EDlAttrDownloadedSize, iTransferredSize );   
  1311          
  1149                     
  1312                     
  1150                 DLTRACE(("Deleting download"));                
  1313                 DLTRACE(("Deleting download"));                
  1151                 DeletePlatformDownload();                
  1314                 DeletePlatformDownload();                
  1152                 }
  1315                 }
  1153             
  1316             
  1177         case EHttpDlFailed:
  1340         case EHttpDlFailed:
  1178             {
  1341             {
  1179             DLTRACE(( "Download failed" ));
  1342             DLTRACE(( "Download failed" ));
  1180             TInt32 errorId = -1;
  1343             TInt32 errorId = -1;
  1181             SetTransferring( EFalse );
  1344             SetTransferring( EFalse );
  1182         	iDownload->GetIntAttribute( EDlAttrErrorId, errorId );
  1345             errorId = iDownload->attribute(LastError).toInt();
       
  1346         
  1183         	DLINFO( ("Error id: %i", errorId ) );
  1347         	DLINFO( ("Error id: %i", errorId ) );
  1184 
  1348 
  1185         	DLINFO( ("Global error id: %i", globalErrorId ) );
  1349         	DLINFO( ("Global error id: %i", globalErrorId ) );
  1186 
  1350 
  1187             if ( iReconnectWhenFail && 
  1351             if ( iReconnectWhenFail && 
  1188                  ( errorId == EConnectionFailed || 
  1352                  ( errorId == EConnectionFailed || 
  1189                    errorId == ETransactionFailed )) 
  1353                    errorId == ETransactionFailed )) 
  1190                 {
  1354                 {
  1191                 DLTRACE(("Try to reconnect"));
  1355                 DLTRACE(("Try to reconnect"));
  1192                 iReconnectWhenFail = EFalse;
  1356                 iReconnectWhenFail = EFalse;
  1193                 iDownload->Start();
  1357                 iDownload->start();
  1194                 break;
  1358                 break;
  1195                 }
  1359                 }
  1196             else if ( errorId == EContentExpired ||
  1360             else if ( errorId == EContentExpired ||
  1197                       errorId == EPartialContentModified )
  1361                       errorId == EPartialContentModified )
  1198                 {
  1362                 {
  1199                 DLTRACE(("Content has changed, reset and restart"));
  1363                 DLTRACE(("Content has changed, reset and restart"));
  1200                 iReconnectWhenFail = EFalse;
  1364                 iReconnectWhenFail = EFalse;
  1201                 iDownload->Reset();
  1365                 iDownload->cancel();
  1202                 iDownload->Start();
  1366                 iDownload->start();
  1203                 break;
  1367                 break;
  1204                 }
  1368                 }
  1205             
  1369             
  1206             ReleasePtr( iConnection );    
  1370             ReleasePtr( iConnection );    
  1207             iState.iOperationState = ECatalogsHttpOpFailed;
  1371             iState.iOperationState = ECatalogsHttpOpFailed;
  1280 */
  1444 */
  1281         /** 
  1445         /** 
  1282         * Download process can be paused again. This event only occurs after
  1446         * Download process can be paused again. This event only occurs after
  1283         * EHttpDlNonPausable. 
  1447         * EHttpDlNonPausable. 
  1284         */	
  1448         */	
       
  1449 /* HLa
  1285         case EHttpDlPausable:
  1450         case EHttpDlPausable:
  1286             {
  1451             {
  1287             DLTRACE(( "Pausable" ));
  1452             DLTRACE(( "Pausable" ));
  1288             iState.iOperationState = ECatalogsHttpOpPausable;
  1453             iState.iOperationState = ECatalogsHttpOpPausable;
  1289             HandleEventProgressL( aEvent );
  1454             HandleEventProgressL( aEvent );
  1315             {
  1480             {
  1316             break;
  1481             break;
  1317             }	
  1482             }	
  1318         }
  1483         }
  1319     }
  1484     }
  1320 
  1485 */
  1321 
  1486 
  1322 
  1487 
  1323 // ---------------------------------------------------------------------------
  1488 // ---------------------------------------------------------------------------
  1324 // 
  1489 // 
  1325 // ---------------------------------------------------------------------------
  1490 // ---------------------------------------------------------------------------
  1326 //	
  1491 //	
       
  1492 /*
  1327 void CCatalogsHttpDownload::HandleEventProgressL( const 
  1493 void CCatalogsHttpDownload::HandleEventProgressL( const 
  1328     THttpDownloadEvent& aEvent )
  1494     THttpDownloadEvent& aEvent )
  1329     {
  1495     {
  1330     DLTRACEIN(( "" ));
  1496     DLTRACEIN(( "" ));
  1331 	switch ( aEvent.iProgressState ) 
  1497 	switch ( aEvent.iProgressState ) 
  1386 		    SetTransferring( EFalse );
  1552 		    SetTransferring( EFalse );
  1387 		    // Don't restart paused downloads or notify about disconnection
  1553 		    // Don't restart paused downloads or notify about disconnection
  1388 		    if ( !iPaused ) 
  1554 		    if ( !iPaused ) 
  1389 		        {		  
  1555 		        {		  
  1390                 TInt32 globalErrorId = 0;
  1556                 TInt32 globalErrorId = 0;
  1391             	iDownload->GetIntAttribute( 
  1557             	    globalErrorId = iDownload->attribute(LastError).toInt();
  1392             	    EDlAttrGlobalErrorId, globalErrorId );
       
  1393             	DLINFO( ("Global error id: %i", globalErrorId ) );
  1558             	DLINFO( ("Global error id: %i", globalErrorId ) );
  1394 
  1559 
  1395                 if ( globalErrorId == KErrCancel ) 
  1560                 if ( globalErrorId == KErrCancel ) 
  1396                     {
  1561                     {
  1397                     DLTRACE(("Cancelled"));
  1562                     DLTRACE(("Cancelled"));
  1493 
  1658 
  1494 		    // Reset reconnect count
  1659 		    // Reset reconnect count
  1495 		    iReconnectCount = KReconnectAttempts;
  1660 		    iReconnectCount = KReconnectAttempts;
  1496 
  1661 
  1497 		    TInt32 size = 0;
  1662 		    TInt32 size = 0;
  1498 	        iDownload->GetIntAttribute( EDlAttrDownloadedSize, size );   
  1663 		     size = iDownload->attribute(DownloadedSize).toInt();
       
  1664 
  1499 	        DLTRACE(("Transferred size from download: %i", size));
  1665 	        DLTRACE(("Transferred size from download: %i", size));
  1500 
  1666 
  1501 	        if ( size != iTransferredSize ) 
  1667 	        if ( size != iTransferredSize ) 
  1502 	            {
  1668 	            {
  1503 	            DLTRACE(("Updating transferred size"));
  1669 	            DLTRACE(("Updating transferred size"));
  1595 		    DLTRACE(("Default"));
  1761 		    DLTRACE(("Default"));
  1596 		    DLTRACE(( "state: %d, progress: %d",aEvent.iDownloadState, aEvent.iProgressState));
  1762 		    DLTRACE(( "state: %d, progress: %d",aEvent.iDownloadState, aEvent.iProgressState));
  1597 			break;
  1763 			break;
  1598 		}
  1764 		}
  1599     }
  1765     }
  1600     
  1766  */   
  1601 
  1767 
  1602 
  1768 
  1603 // ---------------------------------------------------------------------------
  1769 // ---------------------------------------------------------------------------
  1604 // Sets file server session
  1770 // Sets file server session
  1605 // ---------------------------------------------------------------------------
  1771 // ---------------------------------------------------------------------------
  1634 // Constructor
  1800 // Constructor
  1635 // ---------------------------------------------------------------------------
  1801 // ---------------------------------------------------------------------------
  1636 //	
  1802 //	
  1637 CCatalogsHttpDownload::CCatalogsHttpDownload( 
  1803 CCatalogsHttpDownload::CCatalogsHttpDownload( 
  1638     CCatalogsHttpDownloadManager& aOwner, 
  1804     CCatalogsHttpDownloadManager& aOwner, 
  1639     RHttpDownload* aDownload ) :
  1805     Download* aDownload ) :
  1640     iOwner( aOwner ), 
  1806     iOwner( aOwner ), 
  1641     iDownload( aDownload ), 
  1807     iDownload( aDownload ), 
  1642     iState( ECatalogsHttpOpCreated, ECatalogsHttpNone ),
  1808     iState( ECatalogsHttpOpCreated, ECatalogsHttpNone ),
  1643     iRefCount( 1 ), 
  1809     iRefCount( 1 ), 
  1644     iNormalDelete( EFalse ),
  1810     iNormalDelete( EFalse ),
  1657     // Get the id for the download and update iUri
  1823     // Get the id for the download and update iUri
  1658     if ( iDownload ) 
  1824     if ( iDownload ) 
  1659         {        
  1825         {        
  1660         // id part will be updated from disk
  1826         // id part will be updated from disk
  1661         iId = TCatalogsTransportOperationId( iOwner.SessionId(), KErrNotFound );
  1827         iId = TCatalogsTransportOperationId( iOwner.SessionId(), KErrNotFound );
  1662 
  1828 				iQTDownload = new CCatalogsHttpQTDownload(this,iDownload);
       
  1829 				 
  1663         UpdateSecondaryIdL();
  1830         UpdateSecondaryIdL();
  1664         
  1831         
  1665         User::LeaveIfError( SetDeleteState( EDownloadCanBeDeleted ) );
  1832         User::LeaveIfError( SetDeleteState( EDownloadCanBeDeleted ) );
  1666         // Update iUri to match the current URI
  1833         // Update iUri to match the current URI
  1667         UpdateUriL();
  1834         UpdateUriL();
  1698     DLTRACEIN(( "" ));
  1865     DLTRACEIN(( "" ));
  1699     if ( !iContentType.Length() ) 
  1866     if ( !iContentType.Length() ) 
  1700         {
  1867         {
  1701         // Download always exists when this is called so no need to check
  1868         // Download always exists when this is called so no need to check
  1702         DLTRACE(("Updating the content type"));
  1869         DLTRACE(("Updating the content type"));
  1703         iDownload->GetStringAttribute( EDlAttrContentType,
  1870         QString contentType;
  1704             iContentType );
  1871         contentType= iDownload->attribute(WRT::ContentType).toString();
       
  1872         // HLa TBuf<KMaxContentTypeLength>  ContentType(contentType.utf16());
       
  1873         TBuf<256>  ContentType(contentType.utf16());
       
  1874         	iContentType.Copy(ContentType);
       
  1875    
  1705         }
  1876         }
  1706     DLTRACEOUT(("Content-type: %S", &iContentType ));
  1877     DLTRACEOUT(("Content-type: %S", &iContentType ));
  1707     }
  1878     }
  1708 
  1879 
  1709 
  1880 
  1818     {
  1989     {
  1819     DLTRACEIN( ("") );
  1990     DLTRACEIN( ("") );
  1820     // Get the current url of the download
  1991     // Get the current url of the download
  1821     RBuf8 buf;
  1992     RBuf8 buf;
  1822     CleanupClosePushL( buf );
  1993     CleanupClosePushL( buf );
       
  1994     const TInt KMaxUrlLength = 2048;
  1823     buf.CreateL( KMaxUrlLength );
  1995     buf.CreateL( KMaxUrlLength );
  1824     
  1996     QString string;
  1825     User::LeaveIfError( iDownload->GetStringAttribute( EDlAttrCurrentUrl,
  1997 	try
  1826         buf ) );
  1998 	{
       
  1999     string = iDownload->attribute(SourceUrl).toString();
       
  2000 	}
       
  2001     catch(const std::exception& exception)
       
  2002     	{
       
  2003 			 qt_symbian_exception2LeaveL(exception);
       
  2004     	}
       
  2005 
  1827     
  2006     
  1828     // DL manager has the encoded URI
  2007     // DL manager has the encoded URI
  1829     AssignDesL( iEncodedUri, buf );
  2008     AssignDesL( iEncodedUri, buf );
  1830     CleanupStack::PopAndDestroy( &buf );
  2009     CleanupStack::PopAndDestroy( &buf );
  1831     
  2010     
  1865             {
  2044             {
  1866             AddRequestHeaderL( iAddedRequestHeaders, *headers[i] );
  2045             AddRequestHeaderL( iAddedRequestHeaders, *headers[i] );
  1867             }
  2046             }
  1868         else 
  2047         else 
  1869             {
  2048             {
  1870             User::LeaveIfError( iDownload->SetStringAttribute(
  2049 /*            User::LeaveIfError( iDownload->SetStringAttribute(
  1871                 predefined, headers[i]->Value() ) );
  2050                 predefined, headers[i]->Value() ) );*/
  1872             }
  2051             }
  1873         }
  2052         }
  1874 
  2053 
  1875     // Add the headers that don't have a predefined enumeration in
  2054     // Add the headers that don't have a predefined enumeration in
  1876     // the platform DL manager 
  2055     // the platform DL manager 
  1877     if ( iAddedRequestHeaders ) 
  2056     if ( iAddedRequestHeaders ) 
  1878         {
  2057         {
  1879         DLTRACE(( "added request headers: %S", iAddedRequestHeaders ));
  2058         DLTRACE(( "added request headers: %S", iAddedRequestHeaders ));
  1880         User::LeaveIfError( iDownload->SetStringAttribute(
  2059      /*   User::LeaveIfError( iDownload->SetStringAttribute(
  1881             EDlAttrRequestHeaderAddon, *iAddedRequestHeaders ) );
  2060             EDlAttrRequestHeaderAddon, *iAddedRequestHeaders ) );*/
  1882         delete iAddedRequestHeaders;
  2061         delete iAddedRequestHeaders;
  1883         iAddedRequestHeaders = NULL;
  2062         iAddedRequestHeaders = NULL;
  1884         }    
  2063         }    
  1885     DLTRACEOUT((""));
  2064     DLTRACEOUT((""));
  1886     }
  2065     }
  2041 // ---------------------------------------------------------------------------
  2220 // ---------------------------------------------------------------------------
  2042 //	    
  2221 //	    
  2043 TUint CCatalogsHttpDownload::MatchWithPredefinedRequestHeader( 
  2222 TUint CCatalogsHttpDownload::MatchWithPredefinedRequestHeader( 
  2044     const TDesC8& aHeader ) const
  2223     const TDesC8& aHeader ) const
  2045     {
  2224     {
       
  2225     /* HLa
  2046     if ( aHeader.CompareF( KHttpRequestAcceptHeader ) == 0 ) 
  2226     if ( aHeader.CompareF( KHttpRequestAcceptHeader ) == 0 ) 
  2047         {
  2227         {
  2048         return EDlAttrRequestAccept;
  2228         return EDlAttrRequestAccept;
  2049         }
  2229         }
  2050     else if ( aHeader.CompareF( KHttpRequestAcceptCharSetHeader ) == 0 ) 
  2230     else if ( aHeader.CompareF( KHttpRequestAcceptCharSetHeader ) == 0 ) 
  2085         }
  2265         }
  2086     else if ( aHeader.CompareF( KHttpRequestVaryHeader ) == 0 ) 
  2266     else if ( aHeader.CompareF( KHttpRequestVaryHeader ) == 0 ) 
  2087         {
  2267         {
  2088         return EDlAttrRequestVary;
  2268         return EDlAttrRequestVary;
  2089         }
  2269         }
  2090     
  2270     */
  2091     return 0;
  2271     return 0;
  2092     }
  2272     }
  2093     
  2273     
  2094     
  2274     
  2095 // ---------------------------------------------------------------------------
  2275 // ---------------------------------------------------------------------------
  2098 // ---------------------------------------------------------------------------
  2278 // ---------------------------------------------------------------------------
  2099 //	           
  2279 //	           
  2100 TUint CCatalogsHttpDownload::MatchWithPredefinedGeneralHeader( 
  2280 TUint CCatalogsHttpDownload::MatchWithPredefinedGeneralHeader( 
  2101     const TDesC8& aHeader ) const
  2281     const TDesC8& aHeader ) const
  2102     {
  2282     {
       
  2283     /* HLa
  2103     if ( aHeader.CompareF( KHttpGeneralCacheControlHeader ) == 0 ) 
  2284     if ( aHeader.CompareF( KHttpGeneralCacheControlHeader ) == 0 ) 
  2104         {
  2285         {
  2105         return EDlAttrGeneralCacheControl;
  2286         return EDlAttrGeneralCacheControl;
  2106         }    
  2287         }    
  2107     else if ( aHeader.CompareF( KHttpGeneralDateHeader ) == 0 ) 
  2288     else if ( aHeader.CompareF( KHttpGeneralDateHeader ) == 0 ) 
  2117         return EDlAttrGeneralVia;
  2298         return EDlAttrGeneralVia;
  2118         }    
  2299         }    
  2119     else if ( aHeader.CompareF( KHttpGeneralWarningHeader ) == 0 ) 
  2300     else if ( aHeader.CompareF( KHttpGeneralWarningHeader ) == 0 ) 
  2120         {
  2301         {
  2121         return EDlAttrGeneralWarning;
  2302         return EDlAttrGeneralWarning;
  2122         }    
  2303         }
       
  2304         */    
  2123     return 0;
  2305     return 0;
  2124     }
  2306     }
  2125     
  2307     
  2126     
  2308     
  2127 // ---------------------------------------------------------------------------
  2309 // ---------------------------------------------------------------------------
  2130 // ---------------------------------------------------------------------------
  2312 // ---------------------------------------------------------------------------
  2131 //	    
  2313 //	    
  2132 TUint CCatalogsHttpDownload::MatchWithPredefinedEntityHeader( 
  2314 TUint CCatalogsHttpDownload::MatchWithPredefinedEntityHeader( 
  2133     const TDesC8& aHeader ) const
  2315     const TDesC8& aHeader ) const
  2134     {
  2316     {
       
  2317     /*
  2135     if ( aHeader.CompareF( KHttpEntityAllowHeader ) == 0 ) 
  2318     if ( aHeader.CompareF( KHttpEntityAllowHeader ) == 0 ) 
  2136         {
  2319         {
  2137         return EDlAttrEntityAllow;
  2320         return EDlAttrEntityAllow;
  2138         }    
  2321         }    
  2139     else if ( aHeader.CompareF( KHttpEntityContentEncodingHeader ) == 0 ) 
  2322     else if ( aHeader.CompareF( KHttpEntityContentEncodingHeader ) == 0 ) 
  2154         }
  2337         }
  2155     else if ( aHeader.CompareF( KHttpEntityLastModifiedHeader ) == 0 ) 
  2338     else if ( aHeader.CompareF( KHttpEntityLastModifiedHeader ) == 0 ) 
  2156         {
  2339         {
  2157         return EDlAttrEntityLastModified;
  2340         return EDlAttrEntityLastModified;
  2158         }
  2341         }
       
  2342         */
  2159     return 0;
  2343     return 0;
  2160     }
  2344     }
  2161         
  2345         
  2162 
  2346 
  2163 // ---------------------------------------------------------------------------
  2347 // ---------------------------------------------------------------------------
  2192         DLTRACE( ("Reallocating target buffer") );
  2376         DLTRACE( ("Reallocating target buffer") );
  2193         aTarget = aTarget->ReAllocL( headerLength );
  2377         aTarget = aTarget->ReAllocL( headerLength );
  2194         }
  2378         }
  2195 
  2379 
  2196     TPtr8 ptr( aTarget->Des() );
  2380     TPtr8 ptr( aTarget->Des() );
       
  2381     
       
  2382     _LIT8( KHttpFieldSeparator, "\n"); // HLa
       
  2383     const TInt KColon( ':' ); // HLa
  2197     
  2384     
  2198     if( newSize ) 
  2385     if( newSize ) 
  2199         {
  2386         {
  2200         DLTRACE( ("Appending to existing headers") );
  2387         DLTRACE( ("Appending to existing headers") );
  2201         // Append after the existing headers
  2388         // Append after the existing headers
  2243     DLTRACEIN((""));
  2430     DLTRACEIN((""));
  2244     DASSERT( iConnection );
  2431     DASSERT( iConnection );
  2245     
  2432     
  2246     TRAPD( err, 
  2433     TRAPD( err, 
  2247         {
  2434         {
  2248         iOwner.SetConnectionL( *iConnection );
  2435         if ( Config().ConnectionMethod().iType == ECatalogsConnectionMethodTypeDestination )
       
  2436             {
       
  2437             RCmManager cmManager;
       
  2438             CleanupClosePushL( cmManager );
       
  2439             cmManager.OpenL();
       
  2440             RCmDestination dest = cmManager.DestinationL( Config().ConnectionMethod().iId );
       
  2441             CleanupClosePushL( dest );
       
  2442             HBufC* temp = dest.NameLC();    
       
  2443             QString destname;
       
  2444             destname = XQConversions::s60DescToQString( *temp );
       
  2445             CleanupStack::PopAndDestroy( temp );
       
  2446             CleanupStack::PopAndDestroy( &dest ); 
       
  2447             CleanupStack::PopAndDestroy( &cmManager ); 
       
  2448             if ( iOwner.GetDownloadManager() )
       
  2449                 {
       
  2450                 iOwner.GetDownloadManager()->attribute(AccessPoints).toStringList();
       
  2451                 iOwner.GetDownloadManager()->setAttribute(AccessPoint, destname);
       
  2452                 }
       
  2453             }
  2249             
  2454             
  2250         // Update the configuration 
  2455         // Update the configuration 
  2251         if ( iState.iProgressState == ECatalogsHttpNone ) 
  2456         if ( iState.iProgressState == ECatalogsHttpNone ) 
  2252             {
  2457             {
  2253             DLTRACE(("Updating dl config"));
  2458             DLTRACE(("Updating dl config"));
  2254             InitializeDownloadL();
  2459             InitializeDownloadL();
  2255             }
  2460             }
  2256         });
  2461         });
  2257     
  2462    
  2258     if ( err == KErrNone ) 
  2463     if ( err == KErrNone ) 
  2259         {
  2464         {
  2260         err = iDownload->Start();
  2465 						 try
       
  2466 							{
       
  2467 							iDownload->start();
       
  2468 							}
       
  2469 			        catch(const std::exception& exception)
       
  2470 			        	{
       
  2471 							 qt_symbian_exception2LeaveL(exception);
       
  2472 			        	}
  2261         }
  2473         }
  2262     return err;
  2474     return err;
  2263     }
  2475     }
  2264 
  2476 
  2265 
  2477 
  2469     DLTRACEIN(( "aStatus: %x, id: %x", aStatus, OperationId().Id() ));
  2681     DLTRACEIN(( "aStatus: %x, id: %x", aStatus, OperationId().Id() ));
  2470     
  2682     
  2471     TInt err = KErrNone;
  2683     TInt err = KErrNone;
  2472     if ( iDownload ) 
  2684     if ( iDownload ) 
  2473         {    
  2685         {    
  2474         err = iDownload->SetIntAttribute( EDlAttrUserData, aStatus );
  2686 
       
  2687         iStatus = aStatus;
  2475         }
  2688         }
  2476     
  2689     
  2477     return err;
  2690     return err;
  2478     }
  2691     }
  2479 
  2692 
  2480 
  2693 CCatalogsHttpDownload::TDownloadDeleteState CCatalogsHttpDownload::GetStatusState()
       
  2694 	{
       
  2695 		return iStatus;
       
  2696 	}
  2481 // ---------------------------------------------------------------------------
  2697 // ---------------------------------------------------------------------------
  2482 // Gets delete status and download id from the platform download
  2698 // Gets delete status and download id from the platform download
  2483 // ---------------------------------------------------------------------------
  2699 // ---------------------------------------------------------------------------
  2484 //  
  2700 //  
  2485 TInt CCatalogsHttpDownload::GetDeleteState( 
  2701 TInt CCatalogsHttpDownload::GetDeleteState( 
  2489     TInt32 data = 0;
  2705     TInt32 data = 0;
  2490 
  2706 
  2491     TInt err = KErrNotReady;
  2707     TInt err = KErrNotReady;
  2492     if ( iDownload ) 
  2708     if ( iDownload ) 
  2493         {
  2709         {
  2494         err = iDownload->GetIntAttribute( EDlAttrUserData, data );
  2710 
       
  2711         err = iStatus;
  2495         DLTRACE(("Data: %d", data));
  2712         DLTRACE(("Data: %d", data));
  2496         aStatus = static_cast<TDownloadDeleteState>( data );
  2713         aStatus = static_cast<TDownloadDeleteState>( data );
  2497         }
  2714         }
  2498     DLTRACEOUT(("status: %x", aStatus ));
  2715     DLTRACEOUT(("status: %x", aStatus ));
  2499     return err;
  2716     return err;
  2568             // Update the request headers to the download manager but do it
  2785             // Update the request headers to the download manager but do it
  2569             // only once
  2786             // only once
  2570             UpdateRequestHeadersL();                    
  2787             UpdateRequestHeadersL();                    
  2571             }
  2788             }
  2572                 
  2789                 
  2573         // Check if the download has been set progressive
  2790         // Check if the 
  2574         TBool progressive = EFalse;
  2791         //download has been set progressive
  2575         User::LeaveIfError( iDownload->GetBoolAttribute( 
  2792         /* MTA
  2576             EDlAttrProgressive, progressive ) );
  2793          * TBool progressive = EFalse;
       
  2794 		try
       
  2795 		{
       
  2796 		         progressive =iDownload->attribute(Progressive).toBool(); 
       
  2797 		}
       
  2798         catch(const std::exception& exception)
       
  2799         	{
       
  2800 				 qt_symbian_exception2LeaveL(exception);
       
  2801         	}  
  2577 
  2802 
  2578         
  2803         
  2579         // We want to have progressive downloads because then DL manager uses
  2804         // We want to have progressive downloads because then DL manager uses
  2580         // a smaller download buffer which makes progress events much more
  2805         // a smaller download buffer which makes progress events much more
  2581         // frequent. However, something goes wrong if the progressive flag is
  2806         // frequent. However, something goes wrong if the progressive flag is
  2589              // set the flag if it has already been set because it 
  2814              // set the flag if it has already been set because it 
  2590              // messes the download
  2815              // messes the download
  2591              !iFileIsSet ) 
  2816              !iFileIsSet ) 
  2592             {
  2817             {
  2593             DLTRACE(("Setting download as progressive"));
  2818             DLTRACE(("Setting download as progressive"));
  2594             User::LeaveIfError( iDownload->SetBoolAttribute( 
  2819 						try
  2595                 EDlAttrProgressive, ETrue ) );
  2820 						{
  2596             }
  2821 						   iDownload->setAttribute(Progressive,ETrue);
       
  2822 						}
       
  2823 						catch(const std::exception& exception)
       
  2824 						{
       
  2825 							qt_symbian_exception2LeaveL(exception);
       
  2826 						}  
       
  2827 						}
  2597         
  2828         
  2598         // Doesn't pause the download after content type has been received
  2829         // Doesn't pause the download after content type has been received
  2599         User::LeaveIfError( iDownload->SetBoolAttribute( 
  2830 					try
  2600             EDlAttrNoContentTypeCheck, ETrue ) );
  2831 					{
  2601 
  2832 						iDownload->setAttribute(Progressive,ETrue);
       
  2833 					}
       
  2834 					catch(const std::exception& exception)
       
  2835 					{
       
  2836 						qt_symbian_exception2LeaveL(exception);
       
  2837 					}  
       
  2838 **/
  2602         if ( !iFileIsSet )
  2839         if ( !iFileIsSet )
  2603             {
  2840             {
  2604             DLTRACE(("Setting filehandle to download"));
  2841             DLTRACE(("Setting filehandle to download"));
  2605             User::LeaveIfError( iDownload->SetFileHandleAttribute( file ) );
  2842            // User::LeaveIfError( iDownload->SetFileHandleAttribute( file ) );
       
  2843             file.Close();
       
  2844             TInt ret = BaflUtils::DeleteFile( iFs, *iTempFilename );
       
  2845             iDownload->setAttribute(DestinationPath,XQConversions::s60DescToQString(iConfig->Directory()));
       
  2846             iDownload->setAttribute(FileName, XQConversions::s60DescToQString(*iTempFilename));
  2606             iFileIsSet = ETrue;                        
  2847             iFileIsSet = ETrue;                        
  2607             }
  2848             }
  2608 
  2849 
  2609         CleanupStack::PopAndDestroy( &file );        
  2850         CleanupStack::PopAndDestroy( &file );        
  2610         }        
  2851         }        
  2611     }
  2852     }
  2612 
  2853 
  2613 
  2854 Download* CCatalogsHttpDownload::GetDownload()
       
  2855 {
       
  2856 	return iDownload;
       
  2857 }
  2614 // ---------------------------------------------------------------------------
  2858 // ---------------------------------------------------------------------------
  2615 // Delete platform download and reset secondary id
  2859 // Delete platform download and reset secondary id
  2616 // ---------------------------------------------------------------------------
  2860 // ---------------------------------------------------------------------------
  2617 //  
  2861 //  
  2618 void CCatalogsHttpDownload::DeletePlatformDownload()
  2862 void CCatalogsHttpDownload::DeletePlatformDownload()
  2619     {
  2863     {
  2620     if ( iDownload )
  2864     if ( iDownload )
  2621         {
  2865         {
  2622         iDownload->Delete();
  2866         iOwner.GetDownloadManager()->removeOne(iDownload);
  2623         iDownload = NULL;
  2867         iDownload = NULL;
  2624         iId.SetSecondaryId( KErrNotFound );
  2868         iId.SetSecondaryId( KErrNotFound );
  2625         }
  2869         }
  2626     }
  2870     }
  2627 
  2871 
  2631 // ---------------------------------------------------------------------------
  2875 // ---------------------------------------------------------------------------
  2632 //  
  2876 //  
  2633 void CCatalogsHttpDownload::UpdateSecondaryIdL()
  2877 void CCatalogsHttpDownload::UpdateSecondaryIdL()
  2634     {
  2878     {
  2635     TInt32 secondaryId = KErrNotFound;
  2879     TInt32 secondaryId = KErrNotFound;
  2636     User::LeaveIfError( 
  2880     secondaryId = iDownload->id();
  2637         iDownload->GetIntAttribute( EDlAttrId, secondaryId ) );
       
  2638     iId.SetSecondaryId( secondaryId );    
  2881     iId.SetSecondaryId( secondaryId );    
  2639     }
  2882     }
  2640 
  2883 
  2641 
  2884 
  2642 // ---------------------------------------------------------------------------
  2885 // ---------------------------------------------------------------------------
  2673        {
  2916        {
  2674        aName.Delete( dotPos, aName.Length()- dotPos );
  2917        aName.Delete( dotPos, aName.Length()- dotPos );
  2675        aName.Append( aExt );
  2918        aName.Append( aExt );
  2676        }
  2919        }
  2677     }
  2920     }
       
  2921     
       
  2922 CCatalogsHttpQTDownload::CCatalogsHttpQTDownload(CCatalogsHttpDownload* aHttpDownload,Download* aDownload)
       
  2923 	{
       
  2924 		iCatalogsHttpDownload = aHttpDownload;
       
  2925 		iDownload = aDownload;
       
  2926 		connect(iDownload, SIGNAL(downloadEvent(DownloadEvent*)), this,SLOT(downloadEventHandler(DownloadEvent*)));
       
  2927         connect(iDownload, SIGNAL(downloadError(Error)), this,SLOT(downloadErrorHandler(Error)));
       
  2928 	}
       
  2929 	
       
  2930 void CCatalogsHttpQTDownload::downloadEventHandler(DownloadEvent* aEvent)
       
  2931 	{
       
  2932 		iCatalogsHttpDownload->HandledownloadEventL(*aEvent);
       
  2933 	}
       
  2934 void CCatalogsHttpQTDownload::downloadErrorHandler(Error)
       
  2935 	{
       
  2936 		//iCatalogsHttpDownload->HandledownloadEventL(*aEvent);
       
  2937 	}
       
  2938 
       
  2939