Re: Updated: pipelined/halfclosed connections

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 25 Feb 2004 10:30:09 +0100 (CET)

On Tue, 24 Feb 2004, Adrian Chadd wrote:

> It doesn't look like a "trivial" fix. Would you mind if I committed
> the current work, sans re-working the do_next_read flag, so it gets
> some testing? I'm trying to get squid-3 stable before I jump in
> to try and improve someo f the code.

Go ahead. The code is a lot better with your patch than before.

But please verify that the keep-alives work in all cases. With the split
logics this is not so simple to verify by inspecting the patch.

  * Simple keep-alive, no request buffered

  * Partial pipelined request. 2.5 requests sent by client, 2 parsed, 1
executed, 0.5 buffered. Needs to read more.

  * Fully pipelined request. 3 requests sent by client, 2 parsed, 1
buffered, 1 executed. Should parse what it have. Ne need for reading.

  * Half-closed simple. 2 requests sent by client. 2 parsed. Buffer empty.
Needs to read more.

  * Half-closed 1 pipelined. 2 requests sent by client. Connection
half-closed. no request data pending in buffer. Should just kick alive the
next parsed request. No parsing or reading.

  * Half-closed fully pipeline. As the fully pipelined case above.

  * Half-closed aborted. 2.5 requests sent by client, connection
half-closed, 0.5 requests in buffer. this should abort the connection.

All tests are easily reproduciple with nc. Just make request files with 1,
2, 2.5 and 3 requests.

To simulate a normal connection run

  cat testfile - | nc proxy 3128

and in the 2.5 request case press enter after a short while to complete
the request.

to simulate a half-closed connection run

  cat testfile | nc proxy 3128

The first requests should be for something which takes a while to respond
to allow things to settle in a reproducible manner, for example this small
cgi. With pipeline prefetch disabled (default) it does not matter much
what the second and third requests are.

#!/bin/sh
sleep 2
cat << EOF
Content-Type: text/html
Connection: keep-alive
Content-Length: 6

hello
EOF

Regards
Henrik
Received on Wed Feb 25 2004 - 02:30:19 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:04 MST