On Tue, 2009 Aug 25 21:13+0100, Mark Hindley wrote: > > > But what about servers that don't return Content-Length even for > > successful requests? > > This is difficult. I don't think it can have happened really, as I > notice return_file() relies on Content-Length being set to initialise > $explen. It would blow up without that. > > This is my solution. It isn't very elegant, but I think it covers > the issue.
Something's not right here. "-s $$pkfdref" returns 0 for a number of real files, "apt-get update" spews "Bad header line" errors (because files are being returned with "Content-Length: 0"), and then very oddly, it goes into a loop where it downloads dists/lenny/non-free/binary- i386/Packages.bz2 over and over and over again. I tried replacing -s with sysseek($$pkfdref, 0, 1), but same result. (By the way, this is no longer going through thttpd directly, but through a CGI script simulating a near-brain-dead Web server. It does 404s, it does Last-Modified, but barely more than that. It's attached.)
serve.sh
Description: Bourne shell script

