Improper Response

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shashishaw
Forum Newbie
Posts: 3
Joined: Wed Mar 22, 2006 4:40 am

Improper Response

Post 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
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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..
shashishaw
Forum Newbie
Posts: 3
Joined: Wed Mar 22, 2006 4:40 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
shashishaw
Forum Newbie
Posts: 3
Joined: Wed Mar 22, 2006 4:40 am

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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..
Post Reply