Re: POST premature connection close

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 29 Jun 1998 04:04:21 +0200

Peter Heimann wrote:

> The developers of the third-party application believe that Squid
> is at fault. It should interpret "0 bytes read" as end of request,
> and not close the connection before transmitting the response from
> the server. Are they right? If yes, is a patch available?

What you describe is sometimes called half-closed connections.

It is hard to tell by reading the HTTP spec if this is legal in a HTTP
client or not. Most servers does support it however. HTTP does not
define if it is legal or not, but it does say that
   Clients and servers SHOULD both constantly watch for the other
   side of the transport close, and respond to it as appropriate.
(rfc2068, 8.1.4 Practical Considerations)

Squid 1.2 does allow half-closed client connections (unless disabled).
Squid 1.1.X does not.

There is no good reason to use half-closed connections in HTTP clients.
All HTTP requests are required to carry information to clearly define
request boundaries without closing the connection (some server replies
may require close, but never client requests requests).

There is however one very important reasons why clients should not use
half-closed connection:
* It is impossible to distinguish a half-closed from a aborted
connection until some traffic occurs.

---
Henrik Nordström
Sparetime Squid Hacker
Received on Sun Jun 28 1998 - 19:27:20 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:53 MST