ncdengine/engine/transport/src/catalogshttpsessionmanagerimpl.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   124 // ---------------------------------------------------------------------------
   124 // ---------------------------------------------------------------------------
   125 // StartOperation
   125 // StartOperation
   126 // ---------------------------------------------------------------------------
   126 // ---------------------------------------------------------------------------
   127 //	
   127 //	
   128 TInt CCatalogsHttpSessionManager::StartOperation( 
   128 TInt CCatalogsHttpSessionManager::StartOperation( 
   129     MCatalogsHttpOperation* aOperation, TBool aConnect )
   129     MCatalogsHttpOperation* aOperation )
   130     {
   130     {
   131     DLTRACEIN((""));
   131     DLTRACEIN((""));
   132     DLINFO( ("Operation ID: %i, Type: %i", 
   132     DLINFO( ("Operation ID: %i, Type: %i", 
   133         aOperation->OperationId().Id(), aOperation->OperationType() ) );
   133         aOperation->OperationId().Id(), aOperation->OperationType() ) );
   134     DASSERT( aOperation );
   134     DASSERT( aOperation );
   138     DLINFO(("Running operations: %d, transactions: %d, general: %d",
   138     DLINFO(("Running operations: %d, transactions: %d, general: %d",
   139         iRunningOperations, iRunningTransactions, iRunningFromGeneral ));
   139         iRunningOperations, iRunningTransactions, iRunningFromGeneral ));
   140         
   140         
   141     // Make sure the download is removed from queue
   141     // Make sure the download is removed from queue
   142     RemoveFromQueue( aOperation );
   142     RemoveFromQueue( aOperation );
   143        
   143     
       
   144     TBool isRunning = EFalse;
   144 
   145 
   145     // Check if the operation can connect either by using the current AP
   146     // Check if the operation can connect either by using the current AP
   146     // or by opening a new one
   147     // or by opening a new one
   147     if ( aConnect )
   148     TRAPD( err, isRunning = ConnectL( *aOperation ) );
   148         {
   149     if ( err != KErrNone ) 
   149         TBool isRunning = EFalse;
   150         {
   150         TRAPD( err, isRunning = ConnectL( *aOperation ) );
   151         DLTRACEOUT(("Error: %d, err"));
   151         if ( err != KErrNone )  
   152         return err;
   152             {
   153         }
   153             DLTRACEOUT(("Error: %d, err"));
   154         
   154             return err;
   155     if ( !isRunning ) 
   155             }
   156         {
   156         if ( !isRunning ) 
   157         DLTRACEOUT(("Not running, adding to queue"));
   157             {
   158         return AddToQueue( aOperation );
   158             DLTRACEOUT(("Not running, adding to queue"));
   159         }
   159             return AddToQueue( aOperation );
   160         
   160             }
   161     // Check whether operation belongs to general queue or not
   161         }
       
   162      // Check whether operation belongs to general queue or not
       
   163     if ( aOperation->Config().Priority() > ECatalogsPriorityQueued )
   162     if ( aOperation->Config().Priority() > ECatalogsPriorityQueued )
   164         {        
   163         {        
   165         // non-general queues
   164         // non-general queues
   166         if ( iRunningOperations < KMaxConcurrentOperations ) 
   165         if ( iRunningOperations < KMaxConcurrentOperations ) 
   167             {
   166             {