> Tim Bray wrote:
> > Luke said:
> > >Oh Please! Content-length should be required in all MIME type data
> > >transmissions. There should be NO EXCEPTIONS!
> > Uh, this is really HTTP not HTML,
> Yes, but not being a HTTP guru, I'm a bit puzzled to see it. Surely any
> HTTPd server is capable of executing a getfiledetails() or whatever
> before starting transmission. Does what you say imply that they don't
> all do this? Blecch.
Yes the server does this, but only when it is returning a file. Suppose, for
example, the returned data comes from a gateway program -- in this case the
server has no way of knowing the length of the returned data until after the
gateway program terminates.
In practice you could (should) write gateway programs that fill a buffer,
measure the buffer length, create a content-length header, send the data,
and dies, but this is rarely done, and is (I don't think) required.
Server's generally don't do this either, probably for speed.
Currently, when a server break the connection, the client assumes this
to be the end of the data stream. I don't know if they complain about
any mismatch between a content-length and the actual length of the data.