Subject: how to close a HTTP/1.1 connection ?

From: [email-masked]
Date: Mon, 30 Jun 2003 07:39:57 -0400 (EDT)

I am currently writing an application using HTTP/1.1 protocol to send a file to a HTTP server via the HTTP PUT request.

I know that there is a general-header item "connection" that could be used with the value "close" to notify that the client wants to close the connection after the request.

My problem is that if the server returns a 401 response ( or the proxy a 407 response) I don't want the connection to be closed before I anthenticate to it.

So I have decided not to include the connection header item before my job is finished and I would like to know what kind of request I could send to the server with the "connection: close" item.

Bertrand VION

---

From: "Patrick R. McManus" <[email-masked]>
Date: Mon, 30 Jun 2003 08:34:07 -0400

[[email-masked]: Jun 30 07:39]

> So I have decided not to include the connection header item before my job is finished and I would like to know what kind of request I could send to the server with the "connection: close" item.

you can just close the connection when you're done with it. Persistent
connections don't obligate you to send more transactions, they simply
allow you to do so.

side note: the server could always issue a connection close in its
response, or decide to close the connection in between transactions
just like your client can select to do the same thing. Beware of the
race conditions inherent in this latter condition if you are reusing
the connection.

---

From: "Wilfred Nilsen" <[email-masked]>
Date: Mon, 30 Jun 2003 10:03:55 -0700

I have some problems with implementing Digest Authentication for a
small web-server.  I do not know how many browsers support Digest
Authentication.  It seems like Mozilla and IE is supporting some of
the features, although they do not seem to implement preemptive
authorization.

The way I do it is to store the local 'nonce counter' in a session
object and increment the value every time I get a request.  I keep 3
{nonce, nc} pairs.  This is to prevent 'nonce' mismatch if the client
implements preemptive authorization and the client pipelines the
requests.  I simply search for the correct {nonce, nc} pair by
comparing the local nonce with the client nonce.  I then increment the
'nc' value for the {nonce, nc} pair that matches the client nonce.

The problem is that the client sometimes skips a 'nc' value.  For
example, the server and client nonce count matches say to the value
00000016, but then the next value from the client is 00000018?

I see this problem with both Mozilla and IE.

Thanks,

Wilfred

---

From: Duane Wessels <[email-masked]>
Date: Mon, 30 Jun 2003 11:09:04 -0600 (MDT)

> 00000016, but then the next value from the client is 00000018?

Squid implements digest authentication, although I don't know
how many sites really use it.  You might find it helpful to
read through the relevant code.

Squid has an option (nonce_strictness) to allow or reject gaps in
nonce counts.

Duane W.