Re: Updated: pipelined/halfclosed connections

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 26 Feb 2004 03:37:54 -0700

On Thu, Feb 26, 2004, Henrik Nordstrom wrote:
> On Thu, 26 Feb 2004, Adrian Chadd wrote:
>
> > Right, ok. I'm not seeing any half-closed logic popping up in the
> > squid logfiles.
>
> Right.. this is probably due to a mixup in my thoughts..

*nod*

> For Squid to detect half-closed connection it must be trying to read
> another request. So if you have sent two requests the half-closed
> connection will only get detected once the first response is finished
> (second request kicked alive).

Or, even a single request. If it gets an EOF on the read side it
should just have a comm_read() return 0, right?

(I've found more bugs in my handling of stuff here, still..)

> So in addition to the scenarios outlined earlier you also need to test
> with 1 and 1.5 requests. And while you are at it also test with 0.5
> requests to verify that all the resumed parsing and abort cases work
> properly..

*nod*

> Half-closed:
>
> 0.5 abort

Ok. I'll analyse this request.

From this:

adrian@mierda:~/work/squid/tests$ cat testfile0.5
GET http://localhost/cgi-bin/test.cgi HTTP/1.1
Connection: proxy-keepalive
adrian@mierda:~/work/squid/tests$ cat testfile0.5 | nc localhost 3128

Squid does this:

... thats it.ccept: FD 14: accepted
2004/02/26 18:29:54.722| commSetTimeout: FD 14 timeout 300
2004/02/26 18:29:54.722| clientReadSomeData: FD 14: reading request...
2004/02/26 18:29:54.722| comm_read_try: fd 14, size 4095, retval 75, errno 0
2004/02/26 18:29:54.722| Incomplete request, waiting for end of headers
2004/02/26 18:29:54.722| clientReadSomeData: FD 14: reading request...

.. and thats it until the socket times out.

Now, here's a tcpdump of my local conversation:

18:31:36.421730 127.0.0.1.33341 > 127.0.0.1.3128: S 2005892544:2005892544(0) win 32767 <mss 16396,sackOK,timestamp 1399219195 0,nop,wscale 0> (DF)
18:31:36.421766 127.0.0.1.3128 > 127.0.0.1.33341: S 2012731824:2012731824(0) ack 2005892545 win 32767 <mss 16396,sackOK,timestamp 1399219195 1399219195,nop,wscale 0> (DF)
18:31:36.421787 127.0.0.1.33341 > 127.0.0.1.3128: . ack 1 win 32767 <nop,nop,timestamp 1399219195 1399219195> (DF)
18:31:36.422067 127.0.0.1.33341 > 127.0.0.1.3128: P 1:76(75) ack 1 win 32767 <nop,nop,timestamp 1399219195 1399219195> (DF)
18:31:36.422094 127.0.0.1.3128 > 127.0.0.1.33341: . ack 76 win 32767 <nop,nop,timestamp 1399219195 1399219195> (DF)

.. until, when I hit ctrl-C in netcat:

18:31:52.165995 127.0.0.1.33341 > 127.0.0.1.3128: F 76:76(0) ack 1 win 32767 <nop,nop,timestamp 1399234941 1399219195> (DF)
18:31:52.166321 127.0.0.1.3128 > 127.0.0.1.33341: F 1:1(0) ack 77 win 32767 <nop,nop,timestamp 1399234942 1399234941> (DF)
18:31:52.166413 127.0.0.1.33341 > 127.0.0.1.3128: . ack 2 win 32767 <nop,nop,timestamp 1399234942 1399234942> (DF)

Hm. What am I doing wrong?

Adrian
Received on Thu Feb 26 2004 - 03:37:56 MST

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