HTTP response: printed as gibberish?

I've written a very short (and incomplete) HTTP proxy server. When I print out the HTTP response, it sometimes appears as gibberish, whereas sometimes they are printed out fine (is this an issue with big endian/little endian or something completely different?)

Comments

: I've written a very short (and incomplete) HTTP proxy server. When I : print out the HTTP response, it sometimes appears as gibberish, : whereas sometimes they are printed out fine (is this an issue with : big endian/little endian or something completely different?)I looked over your code and nothing stands out as being obviously wrong. I'm not too convinced over the endian thing, though it could be that. I also wonder if HTTP compression could come into it. What is gibberish, out of interest? Is it:-

The HTTP Response HeadersThe BodyBoth

Go to netcraft and look at the info on the servers that you're having the fun with. Is there any kind of OS/server software correlation?

Just a few random thoughts that I can think off hand. Could you maybe post some of the gibberish? There's always an chance it might be recognisable gibberish. ;-)