×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    49

    Unhappy [Undocumented Evil] Download Manager API crashes and timeouts

    Hi!

    I was trying to add Download Manager support in my software, and instead of writing all by myself using the RHttp family classes, I thought to use Download Manager API to simplify my life.

    But it is undocumented and there are no examples at all :|

    I've almost managed to get it work, but I still have some problems (once I get it working, i'll link to my source code).

    That's how I initiate a download:

    Code:
    LBool SymbianCore::RequestResource(const String *pURL, const String *pLocalDest)
    {
    	if(!pURL || pURL->IsEmpty() || !pLocalDest || pLocalDest->IsEmpty())
    		return LFalse;
    
    	if(!m_bIsOnline)
    	{
    		GetFavouriteIap();
    
    		m_rDownloadMgr.ConnectL(KUidLESSA, *this, ETrue );
    		m_rDownloadMgr.SetIntAttribute(EDlMgrIap, m_uIapID );				        m_rDownloadMgr.SetIntAttribute(EDlMgrExitAction, EExitPause);
    		m_rDownloadMgr.DeleteAll();
    
    		m_bIsOnline = LTrue;
    	}
    
    	// Convert string to TDesC8
    	TBool bResult = LFalse;
    	PDO::BaseString::SymbianCore *pSymURL = (PDO::BaseString::SymbianCore *)pURL;
    	HBufC8* buf8Bit = HBufC8::NewLC( pURL->Length() );
    	buf8Bit->Des().Copy( *(pSymURL->GetRawData()) );
    
    	// Add download to download manager..
    	RHttpDownload& download = m_rDownloadMgr.CreateDownloadL( *buf8Bit , bResult );
    	PDO::BaseString::SymbianCore *pSymDest = (PDO::BaseString::SymbianCore *)pLocalDest;
    	download.SetStringAttribute(EDlAttrDestFilename, *(pSymDest->GetRawData()));
    	download.SetIntAttribute(EDlAttrAction, EMove);
    
    	download.Start();
    
    	CleanupStack::PopAndDestroy( buf8Bit );
    
    	return bResult;
    }
    In the event handler member ( HandleDMgrEventL ), that's what happens (in order):

    EHttpDlCreated
    EHttpDlInprogress
    EHttpDlInprogress
    EHttpDlInprogress
    EHttpDlInprogress
    EHttpDlInprogress
    EHttpDlFailed

    Last event is handled like that:

    Code:
    TInt32 iVal = 0L;	// Returns 6, EDlAttrGlobalErrorId
    aDownload.GetIntAttribute(EDlAttrErrorId, iVal);
    
    TInt32 iGenVal = 0L;	// Returns -33, KErrTimedOut 
    aDownload.GetIntAttribute(EDlAttrGlobalErrorId, iGenVal);
    So, what's wrong? I just handle EHttpDlFailed in the event handler...

    Thanks in advance!

    PS: If I don't call DeleteAll(), it crashes giving DMEngine -39 Panic!

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    49

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    Examining with ethereal my packet dump, I noticed that my app request is this:
    Code:
    HEAD http://www.giuseppenapolitano.it/files/nulla2.jpg HTTP/1.1
    
    Host: www.giuseppenapolitano.it
    
    Accept: multipart/mixed, application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.oma.drm.content, application/vnd.wap.mms-message, text/x-co/desc, application/vnd.oma.dd+xml, text/javascript, text/javascript, application/x-javascript, text/ecmascript, */*
    
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Series60/2.8 Nokia6630/4.06.0 Profile/MIDP-2.0 Configuration/CLDC-1.1)
    
    x-wap-profile: "http://nds1.nds.nokia.com/uaprof/N6630r100.xml"
    While built-in emulator browser does:
    Code:
    GET http://www.giuseppenapolitano.it/files/nulla2.jpg HTTP/1.1Host: www.giuseppenapolitano.itAccept: multipart/mixed, application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.oma.drm.content, application/vnd.wap.mms-message, text/x-co/desc, application/vnd.oma.dd+xml, text/javascript, text/javascript, application/x-javascript, text/ecmascript, */*Range: bytes=2629-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Series60/2.8 Nokia6630/4.06.0 Profile/MIDP-2.0 Configuration/CLDC-1.1)x-wap-profile: "http://nds1.nds.nokia.com/uaprof/N6630r100.xml"HTTP/1.1 206 Partial ContentContent-Length: 141812Content-Type: image/jpegContent-Range: bytes 2629-144440/144441Last-Modified: Sun, 21 Nov 2004 13:09:43 GMTAccept-Ranges: bytesETag: "765bb55dcbcfc41:33e6f9"Server: Microsoft-IIS/6.0MicrosoftOfficeWebServer: 5.0_PubX-Powered-By: ASP.NETDate: Wed, 12 Jul 2006 14:10:32 GMT
    Why do download manager make transaction using HEAD instead of GET?

  3. #3
    Registered User
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    49

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    I made it work! You can find a working example of it here, in the SVN repository (Symbianns2Core.cpp and .h file)

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    2

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    Hi Dexterp37,

    I think the code posted by you on LESSA is no longer available. Can you please do a re-post?

    thanx
    Sachin

  5. #5
    Registered User
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    49

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    Quote Originally Posted by sachin@symbian View Post
    Hi Dexterp37,

    I think the code posted by you on LESSA is no longer available. Can you please do a re-post?

    thanx
    Sachin
    Hi!

    My code is still available in Sourceforge's SVN repository. You can reach it from the project page:

    http://sourceforge.net/projects/lessa

    Hope it helps,

  6. #6
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    102

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    Hi Dexterp37,
    kindly mail me your code... I am facing similar issue. It was working fine then all of a sudden it started panicing by giving "DownloadMgrServer.exe::!DownloadMgrServer Panic DMEngine -39" this.

  7. #7
    Registered User
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    49

    Re: [Undocumented Evil] Download Manager API crashes and timeouts

    Quote Originally Posted by kdurga View Post
    Hi Dexterp37,
    kindly mail me your code... I am facing similar issue. It was working fine then all of a sudden it started panicing by giving "DownloadMgrServer.exe::!DownloadMgrServer Panic DMEngine -39" this.
    Hello,
    You can download what you asked for simply following this link:

    http://sourceforge.net/projects/lessa

    Hope it helps,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×