Re: patch: half closed stuff

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 23 Feb 2004 01:37:42 -0700

On Mon, Feb 23, 2004, Henrik Nordstrom wrote:

> > The trouble is this: what do we do if there's still data in the
> > conn in buf?
>
> Right... Forgot about that buffer.

Heh.

> This leaves us pretty much only with the choice of allowing repeated
> comm_read after eof, having comm_read immediately return a zero length
> read like how this was done in 2.5. If not the code path gets a little too
> messed up I am afraid.

Not necessarily. I could break out the request parsing stuff
from clientReadRequest() and be able to call it in other places,
we might be able to kick-start the second request in keepaliveNextRequest()..

Take a look at this, from clientReadRequest().

    /* XXX: if we read *exactly* two requests, and the client sends no more,
     * if pipelined requests are off, we will *never* parse and insert the
     * second. the corner condition is due to the parsing being tied to the
     * read, not the presence of data in the buffer.
     */

I'm pretty sure there was just two requests in this buffer. :-)

> > Should we try to parse it and kick start it as another request?
>
> Yes. If you support half-closed connections then there is no reason why
> pipelining over the same should not be supported.

*nod*

> > Or, do we just give up at this point and throw all the subsequent
> > requests away?
>
> If this is wanted then don't enable half-closed client support.

I agree. I'm just trying to fix a crash here and I'm trying to not
take the cheap way out and simply disable half-closed clients..

Adrian
Received on Mon Feb 23 2004 - 01:37:44 MST

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