httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: cvs commit: httpd-2.0 STATUS
Date Mon, 02 Jul 2001 19:27:13 GMT


> On 02 Jul 2001 15:02:20 -0400, Bill Stoddard wrote:
> >
> > > On Mon, 2 Jul 2001, Bill Stoddard wrote:
> > >
> > > > >
> > > > > >cgi on all platforms is broken.  Specifically, with the addition
of
> > > > > >filters, we have lost the ability to flush partially written
buffers
> > > > > >received from CGI scripts to the network.
> > > > > [...]
> > > > > >Apache 2.0 always does a blocking read (in the content length
filter)
> > > > >
> > > > > Partial writes to the network from a CGI and content length are
> > > > > mutually exclusive.
> > > > >
> > > >
> > > > No S**t!! :-) That's why it's broken!
> > > >
> > > > Working on a fix now.
> > >
> > >
> > > Bill, there is no fix for this.  If the content_length filter determines
> > > that a C-L is required, then we can't stream CGI's.  It looks like the
> > > problem is simply that we are using the wrong options to apr_bucket_read.
> > > Switch that to a APR_NONBLOCK_READ, and the problem should go away.
> > >
> > > Ryan
> >
> > I don't think changing the read in the content_length filter to nonblocking is the
right
> > solution to this problem because we still need to force the network flush. I will
> > investigate your suggestion though because I might be overlooking something.
> >
> > IMO the decision to flush or not and how to read from the pipe should be entirely
> > controlled by mod_cgi.  We need a function similar to the old ap_send_fb() code.
> >
> > To demonstrate, here is some code.   YES YES YES I know we don't want to commit
this
as
> > written. This code will cause a data copies of all bytes off the stack buffer and
into
a
> > heap buffer. Making this zero copy is easy enough, just wanted to post what I have
been
> > playing with the last 30 minutes to generally show how I think we should solve this
> > problem (ie, control the byte stream at the top of the filter chain rather than
deep
in
> > the filter chain).
> >
> > I also want to play with making the interface between Apache and CGI scripts full
duplex
> > as well (to allow a CGI script to read a large POST request and begin responding
to
that
> > POST immediately) which will require controlling the byte stream at the top of the
filter
> > stack as well.
> >
> > Bill
>
> Hi Bill,
> I was wondering if there was a generic way of doing this in a generic
> fashion so that ALL dynamic content modules (perl/jk/proxy etc)
> would be affected (maybe putting it into the socket/pipe bucket read
> functions)
>

I presume you mean both the full duplex and nonblocking/flush stuff.  Seems we should be
able to create a function similar to the Apache 1.3 function ap_send_fb() with a couple of
additional parameters to handle an input as well as an output stream. I'll give it some
thought.

Bill


Mime
View raw message