Hello!
I was a bit in doubt if posting the message here, or in
comp.unix.programmer. I choosed this group even if the problem is a bit
programming related.
I have a web server running on localhost, and a file named "foo.txt"
residing in the web root. Issuing the request
http://localhost/foo.txt
, works fine with any http client and even manually :
azi@magicb0x ~ $ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /foo.txt HTTP/1.1
HTTP/1.0 200 OK
Date: Thu, 05 Oct 2006 15:25:22 GMT
Content-Type: text/html
Content-Length: 7
foobar
Connection closed by foreign host.
So, you may be thinking what's the problem. using wget to retrive the
file gives a "screwed" file :
azi@magicb0x ~ $ wget localhost/foo.txt
--15:26:43--
http://localhost/foo.txt
=> `foo.txt'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 No headers, assuming
HTTP/0.9
Length: unspecified
15:26:43 (4.64 MB/s) - `foo.txt' saved [112]
azi@magicb0x ~ $ cat foo.txt
HTTP/1.0 200 OK
Date: Thu, 05 Oct 2006 15:26:43 GMT
Content-Type: text/html
Content-Length: 7
foobar
azi@magicb0x ~ $
wget works fine if the file is placed on some other web site, so i'm
100% it's the web server fault (it's my code, and it looks like I
missed something :-). I have no clue where the fault may be, and i
really hope someone from the list can help me! I think it has something
to do with the above routine :
http://rafb.net/paste/results/yahFj799.html .
Regards!