I can't get one thing straight. The RFC 2616 in 4.4.5 states that Message Length
can be determined "By the server closing the connection.
".
This implies, that it is valid for a server to respond (e.g. returning a large image) with a response, that has no Content-Length
in the header, but the client is supposed to keep fetching till the connection is closed and then assume all data has been downloaded.
But how is a client to know for sure that the connection was closed intentionally by the server? A server app could have crashed in the middle of sending the data and the server's OS would most likely send FIN
packet to gracefully close the TCP connection with the client.