httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: [PATCH] allocate properly-sized buffer for header
Date Thu, 25 Jan 2001 18:30:14 GMT writes:

> > > This looks okay, but it is a very fragile solution.  The real problem
> > > IMHO, is that the bucket API is wrong.  This is just another symptom of
> > > the small bucket problem.  I think having to check for the length of the
> > > headers is a bad idea, because it will slow us down every time.  What we
> > > really want, is the same solution for the coalesce filter, namely the
> > > apr_brigade_* stuff, in whatever form it takes.
> > > 
> > > What the ap_r* patch did was fix a symtpom, it didn't cure the disease.  
> > > This is another symptom.
> > 
> > I'm not sure I agree with your big picture*, but apr_brigade_* stuff
> > would definitely be a big improvement for this code.  Heck, ap_r* or
> > even ap_b* would be a big improvement for this code :)
> But ap_r* doesn't work in this case, because we aren't in a handler.

I'm with ya... I didn't mean it so literally :)

> > *I'm extremely uncomfortable with the idea that a buffered API has no
> > way to get rid of the data -- e.g., ap_pass_brigade() -- before
> > returning to the caller.
> It would be possible to create ap_f* functions with the apr_brigade_*
> functions, which would buffer and still provide the ap_pass_brigade call
> before returning to the caller.  This would also allow filter writers to
> avoid dealing with brigades directly.  I'll work up a REALLY quick patch
> that shows the ideas without being perfectly correct.

But apr_brigade_*() will still use an unbounded amount of storage in
handling a particular operation, unless the wrapper function has to
split up the operation into chunks, with ap_pass_brigade() between
chunks (to avoid building up huge brigade and thus use an unfair
amount of the system's virtual memory for this one request).

When the wrapper function has such a useful property, who is going to
use the underlying routine?

Jeff Trawick | | PGP public key at web site:
             Born in Roswell... married an alien...

View raw message