httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: httpd-2.0/server request.c
Date Thu, 07 Jun 2001 03:34:26 GMT
On Wed, Jun 06, 2001 at 10:58:25PM -0400, Jeff Trawick wrote:
> Greg Stein <gstein@lyra.org> writes:
>...
> > If your platform has MMAP, then the file bucket will be transformed into an
> > MMAP bucket and the read() will return the entire file contents. Then, for a
> > Debug build, you'll crap out at the assert. In a non-debug build, you'll end
> > up creating a TRANSIENT bucket in tmpbb which then becomes bogus when you
> > apr_destroy_brigade(bb).
> 
> The assert never fails, debug or not...  I've been through that loop :)

Did you shove in a BIG file? ie. bigger than 8 or 9k? (whatever the value is
nowadays)

That should have sparked the assert.

[reviewing code again]

Okay. The subreq FILE bucket would need to be between 8k and 4M. The
apr_bucket_read() will then return a ptr/len for the entire mmap. That
should trigger the assert.

[ if *not*, then I'd like to figure out why, to ensure that some subtle bug
  isn't hiding from us ]

> Where does the TRANSIENT bucket come from?  It should be a HEAP bucket.

In apr_brigade_write(). If it can't shove the str/len data into a HEAP
bucket at the end of the brigade (an existing one, or a new one; where the
new one is size-limited), then it will create a TRANSIENT bucket for the
data and signal that a "flush" should be done. But we don't pass a flush
function, so the transient bucket just sits in there.

It is some complicated logic in apr_brigade_write and check_brigade_flush in
apr_brigade.c. (those two functions should be combined; having them separate
was somewhat reasonable when apr_brigade_* all need to call it, but they all
use _write now)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message