hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Connection closed too early - incomplete response?

 
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle View previous topic
View next topic
Connection closed too early - incomplete response?
Author Message
foobar



Joined: 25 Oct 2008
Posts: 1

Post Connection closed too early - incomplete response? Reply with quote
Greetings .*,

I've run into a problem of which I'm unsure if I understand it correctly, and so far failed to fix. For larger levels, I only receive a part of the page before the server closes the connection. (When I check in Firefox, it seems to have no problem and gets the full thing.)

At first I expected a bug in my code, but then I tried sending my request with netcat and that also reproduced it.

With request.txt as
Code:
GET /runaway/index.php?gotolevel=500 HTTP/1.1
User-Agent: netcat
Connection: close
Cookie: phpbb2mysql_data=...*snip*
Host: www.hacker.org


and the command
Code:
cat request.txt | nc www.hacker.org 80

the response body is cut off somewhere inside the first copy of the level description.

Putting printfs into my code, to output the expected and received chunk lengths, this is what I get:
Code:
remaining expected received errmsg
134977    2048     2048     null
132929    2048     2048     null
130881    2048     2048     null
128833    2048     2048     null
126785    2048     2048     null
124737    2048     2048     null
122689    2048     2048     null
120641    2048     2048     null
118593    2048     2048     null
116545    2048     2048     null
114497    2048     2048     null
112449    2048     2048     null
110401    2048     2048     null
108353    2048     2048     null
106305    2048     2048     null
104257    2048     2048     null
102209    2048     2048     null
100161    2048     2048     null
 98113    2048     2048     null
 96065    2048     2048     null
 94017    2048     2048     null
 91969    2048     2048     null
 89921    2048     2048     null
 87873    2048     2048     null
 85825    2048     2048     null
 83777    2048     2048     null
 81729    2048     2048     null
 79681    2048     2048     null
 77633    2048     2048     null
 75585    2048     2048     null
 73537    2048     2048     null
 71489    2048     2048     null
 69441    2048     0        closed


That is, of about 131.8kB, only the first (exactly) 64kB are transferred and then the connection is closed, leaving about 67.8kB still missing.

Is this a hard-limit configured into the server? Or is there something I can do to fix this?

(One thing I could try to do is send the "Accept-Encoding: gzip" header, which should reduce the size a lot (with the whole level description being included twice and the map being essentially just a bitmap.) Maybe this is why it works in Firefox... But that's more work that I'd like to avoid if there's a simpler fix.)
Fri Sep 18, 2015 1:54 am View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 472
Location: Germany

Post Re: Connection closed too early - incomplete response? Reply with quote
foobar wrote:
One thing I could try to do is send the "Accept-Encoding: gzip" header


Apparently that is exactly what you have to do. See also this thread.
Sun Sep 20, 2015 11:40 pm View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 472
Location: Germany

Post Reply with quote
I have just realized that you have already completed the 512 levels which exist. To the best of my knowledge there aren't any more beyond that. So you cannot advance further here. Unless more levels get implemented of course.
Wed Sep 23, 2015 6:09 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.