httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject Re: How to achieve zero-copy when reading request headers?
Date Sun, 30 Jun 2002 08:02:38 GMT
On Sat, 2002-06-29 at 23:57, Justin Erenkrantz wrote:

> Reading the headers as an input filter could be too late for 
> request processing as that could be done as late as the handlers.

It will happen long before then: ap_read_request() causes a read
on the input filter chain at the start of the request processing.

> We have to have this information *before* any request processing
> occurs.
> 
> Perhaps doing a way to split a brigade in the core input filter
> with a CRLFCRLF instead of a simple CRLF will allow us to get
> back a brigade which represents the entire MIME headers.  That
> should solve most of our problems.

Unfortunately, the header won't necessarily end with CRLFCRLF.
HTTP/0.9...

> I'd look at apr_brigade_split_line and add a variation that does
> CRLFCRLF and see how that works performance-wise.  You'll get a
> brigade back that should represent all of the headers.  (This may
> mean adding a special input mode to the filters, but I think I can
> live with this - AP_MODE_GETMIMEHEADERS or something like that.
> And this means that ssl's input filter would need to be adapted
> to handle this as well - urgh.)

Aside from the HTTP/0.9 problem, I'd hate to complicate all the
filters with a new mode.  That's why I'd much prefer to create
an "HTTP header filter" that we can push onto the input filter
stack in ap_read_request() (and remove once we've parsed the
request header): let this filter do the scanning for the various
forms of HTTP header, remove the header from the brigade, and
leave the rest of the brigade for subsequent input filters to
handle.

--Brian



Mime
View raw message