diff -r 79859ed3eea9 -r 919f36ff910f browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrSrvSession.cpp --- a/browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrSrvSession.cpp Tue Aug 31 16:17:46 2010 +0300 +++ b/browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrSrvSession.cpp Wed Sep 01 12:28:30 2010 +0100 @@ -16,15 +16,14 @@ * */ - // INCLUDE FILES #include "DownloadMgrLogger.h" #include "DownloadMgrServer.h" #include "DownloadMgrDef.h" #include "DownloadMgrEventQueue.h" -#include -#include +#include "HttpClientAppInstance.h" +#include "HttpDownload.h" #include #include @@ -146,6 +145,7 @@ if( iComplete || ( KErrNone != err ) ) { // Only the syncron requests has to be completed here! + if ((!aMessage.IsNull()) && (!CurrentMessage().IsNull()) ) aMessage.Complete( err ); } } @@ -174,6 +174,11 @@ // check for session-relative requests switch( aMessage.Function() ) { + case EHttpDownMgrNumOfSubSessions: + { + GetNumberOfSubsession(); + return; + } case EHttpDownloadMgrInitialize: { InitializeL(); @@ -312,6 +317,24 @@ } // --------------------------------------------------------- +// CDownloadMgrSession::GetNumberOfSubsession +// --------------------------------------------------------- +// +void CDownloadMgrSession::GetNumberOfSubsession() + { + TInt32 value(0); + for( TInt i = 0; i < iObjectIx->Count(); i++ ){ + CDownloadSubSession* downloadSess + = ( CDownloadSubSession* )(*iObjectIx)[i]; + if( downloadSess != NULL ){ + value++; + } + } + TPckg pckg( value ); + Write( 0, CurrentMessage(), pckg ); + } + +// --------------------------------------------------------- // CDownloadMgrSession::InitializeL // --------------------------------------------------------- // @@ -332,8 +355,9 @@ CArrayPtrFlat* currentDownloads = iClientAppInstance->DownloadsL(); TPckg countPckg( currentDownloads->Count() ); TPckg sessionId( iSessionId ); - + if (!CurrentMessage().IsNull()) Write( 1, CurrentMessage(), countPckg ); + if (!CurrentMessage().IsNull()) Write( 3, CurrentMessage(), sessionId ); CLOG_NAME_2( _L("Session_%x_%x"), uidPckg().iUid, iSessionId );