On 24/07/2011, at 4:09 AM, NARUSE, Yui wrote:
> On request, it can't use closing the connection.
> RFC 1945 (HTTP/1.0) says:
> ---
> 7.2.2 Length
>
>   When an Entity-Body is included with a message, the length of that
>   body may be determined in one of two ways. If a Content-Length  
> header
>   field is present, its value in bytes represents the length of the
>   Entity-Body. Otherwise, the body length is determined by the closing
>   of the connection by the server.
>
>   Closing the connection cannot be used to indicate the end of a
>   request body, since it leaves no possibility for the server to send
>   back a response.

You can close just the writing end using shutdown(), and still read a  
response.

> Therefore, HTTP/1.0 requests containing an entity
>   body must include a valid Content-Length header field.

Sorry, but this is false.

Clifford Heath.

> If a request
>   contains an entity body and Content-Length is not specified, and the
>   server does not recognize or cannot calculate the length from other
>   fields, then the server should send a 400 (bad request) response.
> ---
>
>> So yes, it's complicated. Sometimes wholesale replacement (and  
>> providing a
>> fallback option) is a better strategy than stepwise refinement.
>
> We like providing new but easier method to introduce a better  
> strategy.
>
> Anyway, akr's point is not about current implementation.
> It is wycats' new idea that "Making HTTP similar to IO".
>
> -- 
> NARUSE, Yui  <naruse / airemix.jp>
>