×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Question What does HTTPCLIENT 5 panic means?

    Hello I was tryng an http connection engine and the following line pops in the code .
    Code:
    void CPMHttpEngine::DoPostL(/*const TDesC& connectUrl*/)
    	{
    	/*TBuf8<connectUrl.Length()> buf8;
    	buf8.Copy(connectUrl);*/
    	TUriParser8 uri;
    //	User::LeaveIfError(uri.Parse(buf8));
    	User::LeaveIfError(uri.Parse(iUrl));
    			
    	// Get request method string for HTTP POST
    	//RStringF method = iHttpSession.StringPool().StringF(HTTP::EPOST, RHTTPSession::GetTable());
    	RStringF method = iHttpSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable());
    	
    	// Open transaction with previous method and parsed uri. This class will 
    	// receive transaction events in MHFRunL and MHFRunError.
    	iTransaction = iHttpSession.OpenTransactionL(uri, *this, method);
    #ifndef __WINS__ 
    	CHttpFilterProxyInterface::InstallFilterL(iHttpSession);
    #endif
    	// Set headers for request; user agent, accepted content type and body's 
    	// content type.
    	RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
    	SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    	SetHeaderL(hdr, HTTP::EAccept, KAccept);
    	//SetHeaderL(hdr, HTTP::EContentType, KContentTypeForm);
    
       	//iTransaction.Request().SetBody(*iHttpForm); 	
    
    	// Submit the transaction. After this the framework will give transaction
    	// events via MHFRunL and MHFRunError.
    	iTransaction.SubmitL();
    
    	iRunning = ETrue;
    	if (iHttpForm == iGetTasksForm)
    		{
    		iTransactionObserver->ConnectingToServerL(ETrue);
    		}
    	else
    		{
    		iTransactionObserver->ConnectingToServerL(EFalse);
    		}
    	}
    
    void CPMHttpEngine::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
    	{
    	MHTTPDataSupplier* body = aTransaction.Response().Body();
    	switch (aEvent.iStatus) 
    		{
    		case THTTPEvent::EGotResponseHeaders:
    			{
    			// HTTP response headers have been received. Use
    			// aTransaction.Response() to get the response. However, it's not
    			// necessary to do anything with the response when this event occurs.
    
    			RHTTPResponse resp = aTransaction.Response();
    			TInt status = resp.StatusCode();
    			RStringF statusStr = resp.StatusText();
    			TBuf<32> statusStr16;
    			statusStr16.Copy(statusStr.DesC());
    			TBuf<100> header;
    			_LIT(KHeader,"Header=>Status =");
    			header.Copy(KHeader);
    			header.Append(statusStr16);
    			_LIT(Ksep,"       Body=");
    			header.Append(Ksep);
    			iParent->iLog.Write(header);
    			// iUtils.Test().Printf(_L("Status: %d (%S)\n"), status, &statusStr16);    *** Shrikanta ***
    
    			}
    			break;
    
    		case THTTPEvent::EGotResponseBodyData:
    			{
    //			MHTTPDataSupplier* body = aTransaction.Response().Body();
    			TPtrC8 dataChunk;
    //			TInt totsize=body->OverallDataSize();
    			
    			TBool val=body->GetNextDataPart(dataChunk);
    			body->ReleaseData();
    			WriteDataL(dataChunk);			
    			}
    			break;
    			
    			// Indicates that header & body of response is completely received.
    		case THTTPEvent::EResponseComplete:
    			{
    //			MHTTPDataSupplier* body = aTransaction.Response().Body();
    			TPtrC8 dataChunk;
    //			TInt totsize=body->OverallDataSize();
    ************************ERROR*********
    			body->GetNextDataPart(dataChunk);
    ****************************************
    			body->ReleaseData();
    			WriteDataL(dataChunk);
    						}
    //			break;
    		
    		// Indicates that transaction succeeded.
    		case THTTPEvent::ESucceeded:
    			{
    			iTransaction.Close();
    			iRunning = EFalse;
    			iParent->iLog.Write(iReceivedData->Des());
    			CResponse* response = CResponse::NewLC(iMode,iParent);
    			TRAPD(error,
    					response->InputDataL(*iReceivedData);
    					iTransactionObserver->SuccessL(*response);
    					CheckRefreshL();)
    					PanicIfError(error);
    
    					CleanupStack::PopAndDestroy(response);						
    			}
    			break;
    
    		// Transaction completed with failure.
    		case THTTPEvent::EFailed:
    			{			 
    			iTransaction.Close();
    			iRunning = EFalse;
    
    			// After transaction has been closed, leaves are no 
    			// longer handled by the calling active object.
    			TRAPD(error,
    			iTransactionObserver->FailedL(0);
    			CheckRefreshL();)
    			PanicIfError(error);
    			}
    			break;
    
    		default:
    			// There are more events in THTTPEvent, but they are not usually 
    			// needed. However, event status smaller than zero should be handled 
    			// correctly since it's error.
    			{
    			if (aEvent.iStatus < 0)
    				{
    				// Just close the transaction on errors
    				iTransaction.Close();
    				iRunning = EFalse;
    				
    				// After transaction has been closed, leaves are no 
    				// longer handled by the calling active object.
    				TRAPD(error,
    				iTransactionObserver->FailedL(aEvent.iStatus);
    				CheckRefreshL();)
    				PanicIfError(error);
    				} 
    			else 
    				{
    				// Other events are not errors (e.g. permanent and temporary
    				// redirections)
    				}
    			}
    			break;
    		}
    	}

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: What does HTTPCLIENT 5 panic means?

    There is no Body for EResponseComplete as I know.

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    66

    Re: What does HTTPCLIENT 5 panic means?

    You could try checking the System Panic Reference, in the reference that comes with the SDK. Maybe you already know this but it's in the folder S60Doc (in the sdk), generally with the name of symbian_devlib.chm. On the help tree, go Symbian OS vx.x/Symbian OS Reference/System Panic Reference.

    Cheers!

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Arrow Re: What does HTTPCLIENT 5 panic means?

    Quote Originally Posted by wizard_hu_ View Post
    There is no Body for EResponseComplete as I know.
    There was none too . But on debugging I saw that when the response come in parts the in last loop control enters
    THTTPEvent::EResponseComplete: and not EGotResponseBodyData: .Looging the response in a logfile i can see that last data part is expected which should be coming down with last loop so I just copy pasted the EGotResponseBodyData: code in EResponseComplete:. to see.

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    31

    Re: What does HTTPCLIENT 5 panic means?

    Quote Originally Posted by gigglie View Post
    There was none too . But on debugging I saw that when the response come in parts the in last loop control enters
    THTTPEvent::EResponseComplete: and not EGotResponseBodyData: .Looging the response in a logfile i can see that last data part is expected which should be coming down with last loop so I just copy pasted the EGotResponseBodyData: code in EResponseComplete:. to see.
    Was you able to get a full body data?
    My problem is - when I try to debug on epoc - everything works.
    When I do debug on real device - as body data I get something like this

    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"h\x0200\x0100

    But the actual html file is only 4 lines
    <html>
    <body>
    Test
    </body>
    </html>


    Can't get the real content "Test".

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Vadodara, Gujarat (INDIA)
    Posts
    29

    Re: What does HTTPCLIENT 5 panic means?

    Hi,

    I am having this same problem....

    My server sends response in <html><body>Some other tags + data</body></html> and I get the same response on Emulator and NokiaE62 device but when testing on Nokia N95 device I get something like...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    </head>
    <body>..... Further data here......

    The problem is some of the important tags in the response data are missing on N95 device. How did you solve this issue? what is the cause of this behavior?

    I have referred WebClient example to write HTTP Request/Response code. Here the problem is that the code works well when I first time connect. But when I post second request it crashes the device. The WebClient code also crashes when you send second request... I am not sure how do I send multiple (one by one) request to my server.

    Any help or pointer is much appreciated. Thanks

    Regards,
    Mehul

    Regards,
    Best Regards,
    Mehul Patel
    Software Developer.
    (Palm OS, Symbian & Windows Mobile)

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: What does HTTPCLIENT 5 panic means?

    You should check the user-agent string, that is the only way a web-server can differentiate between clients.

Similar Threads

  1. Using Bluetooth serial port in MIDlets (nokia 9500 issue)
    By orsteglasy in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2007-10-07, 21:49
  2. Panic "CBA 2" means what ?
    By amitkankani in forum Symbian
    Replies: 0
    Last Post: 2007-04-24, 12:13
  3. MDFVideoGateway panic, what's panic means?
    By samooha_2020 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2007-02-09, 19:55
  4. What do AKNFEP 23 panic means?
    By cereus123 in forum Symbian
    Replies: 6
    Last Post: 2006-12-28, 18:44
  5. FSCLIENT panic 24 means???????
    By giridharn in forum Symbian
    Replies: 1
    Last Post: 2004-12-06, 12:22

Posting Permissions

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