Page 1 of 1

Improper Response

Posted: Wed Mar 22, 2006 4:49 am
by shashishaw
Hi All,
The problem i am facing is as mentioned.

I am Series 60 developer and am working on symbian os.
When i make a HTTP Get request from a PHP site, in the response that i receive i get some random data bytes (characters) along with the actual response. I am parsing the actual response for particular fields. But due to the presence of the extra bytes, the parsing fails. This is valid for many of the php sites.

What could be the reason for the extra random bytes that come down.

E.g
When u check the response received for the below mentioned site, the response contains extra bytes just after the header.
http://www.cdt.org/security/010911response.php

The response can be viewed using
http://www.rexswain.com/httpview.html

Kindly help.
Thanks in advance

Posted: Wed Mar 22, 2006 6:52 am
by onion2k
Very odd. I don't think it's anything to do with PHP though. I get a few characters on all URLs including Google, Yahoo, Slashdot .. the only one that didn't have anything extra was Microsoft. I guess you're going to have to get your head into the HTTP protocol to figure out what exactly is going on..

Posted: Wed Mar 22, 2006 7:36 am
by shashishaw
Hi onion2k ,
Thanks for the reply. I first came across the problem while testing the php sites and hence felt that this could be a php issue. However as u have rightly pointed out, it is also prevalent in other sites as well.
As far as i know, the total number of bytes for the page should be equal to the Content-Length field value mentioned in the Response Header( if the content length field is present).
I am trying to look into the details of the http protocol.

How do web browsers treat the random data bytes ?. One more serious problem was that in one of links which sent down an image, the random data bytes were part of the actual image data. This further aggravates the problem.

Any pointers on how to avoid retrieving the extra data will be helpful.

Thanks
Shashi.

Posted: Wed Mar 22, 2006 9:23 am
by feyd
I have to agree with onion2k that it would appear to be your script, as a script I wrote to do very similar queries does not show the extra bytes.

Posted: Fri Mar 31, 2006 6:44 am
by shashishaw
Hi,
I've found from the link http://developers.sun.com/techtopics/mo ... /chunking/ , that the random characters are nothing but the size of the chunks in which the data coming down is divided.

Posted: Fri Mar 31, 2006 8:02 am
by onion2k
shashishaw wrote:Hi,
I've found from the link http://developers.sun.com/techtopics/mo ... /chunking/ , that the random characters are nothing but the size of the chunks in which the data coming down is divided.
So they're not random at all then..