httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <>
Subject Re: Extraneous socket read?
Date Fri, 27 Jul 2001 16:14:47 GMT
Are you still considering working on an APR_INCOMPLETE_READ/APR_OPTIMISTIC_READ socket
option?  I think something like this will be useful to the lingering close code
(ap_lingering_close).  During lingering close, we do a non-blocking read first which
returns EAGAIN then do a select.  In this case, it is clearly a win to just do the select
(since the common case will be that we have no bytes to read on the inbound side of the
connection) and avoid the initial read altogether.

I think I prefer the existing operation (read then select) for the default but would like
a way to tell APR to do a select then a read for special cases like this.


> On Sat, 7 Jul 2001, Brian Pane wrote:
> > If I'm reading the code right, there's one problem with this approach: the
> > APR_INCOMPLETE_READ flag doesn't get set until after the first
> > read on a socket, so the first read on a new connection (the one that
> > usually
> > returns EAGAIN) doesn't get skipped like it should.  I _think_ the solution
> > is to set APR_INCOMPLETE_READ on any newly created socket, unless
> > you can think of cases where that would break something else.
> oh right.
> plus there's one more thing to take into account:  FreeBSD's
> SO_ACCEPTFILTER and linux's TCP_DEFER_ACCEPT ... both of which won't
> present a socket for accept until there's some data to be read.
> hmm.  we don't have TCP_DEFER_ACCEPT support yet.
> -dean

View raw message