httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <>
Subject Re: How to achieve zero-copy when reading request headers?
Date Mon, 01 Jul 2002 04:44:41 GMT
On Sun, 2002-06-30 at 21:30, Justin Erenkrantz wrote:
> On Sun, Jun 30, 2002 at 09:14:20PM -0700, Brian Pane wrote:
> > The brigade can't be in a filter context, because then it wouldn't be
> > accessible from ap_rgetline_core().  The request_rec is the only place
> > where we could easily put this brigade.  We just need to name it
> > something like "temp_working_brigade" and document the fact that any
> > function that puts things in that brigade must clear them out before
> > it exits.
> This brigade can't be used by anything other than ap_rgetline_core().
> I think allowing it to be used by *anything else* is going to cause
> problems later on.  I just finished cleaning up most of the invalid
> references to req_cfg->bb and now you want to add it back.
> Documenting it as temp_working_brigade is just going to declare
> open season on misuse.
> *sigh*
> > The pool cleanup registration and cancel operations aren't particularly
> > inefficient (though I think there's some room for optimization).  The
> > problem is the large number of calls to these operations per request,
> > due to the multiple brigade creations/deletions per header line.
> It should only be one brigade per-line, right?

It should only be one.  But it's not.  The speculative read to
check for a '\t' at the start of the next line uses a separate

Hmmm...I might as well fix that now; it will speed things up a
little while we figure out the best solution for the more
general problem of temp brigade management.

> How about adding a variant of ap_rgetline_*() that takes in a
> temporary brigade and ap_get_mime_headers() can create one brigade to
> be used for all headers.

+0.  If we create the temp brigade in ap_get_mime_headers(), we'll
still be doing the brigade creation/deletion for the first line of
the request.  We really need to create the temp brigade in
ap_read_request(), and then pass it through a variant of
ap_get_mime_headers() that takes the temp brigade as an input.


View raw message