httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: SSL support
Date Sun, 04 Feb 2001 19:09:00 GMT

> >  It
> > would be possible for you to do the following, although for most filters
> > it is unadvisable unless you really understand what is happening:
> > 
> > ssl_input_filter(f, bb)
> > {
> >     conn_rec *c = f->c;
> >     apr_bucket_brigade *output_data;
> >     ap_filter *output_filters = c->output_filters;
> > 
> >     b = AP_BRIGADE_FIRST(bb);
> >     apr_bucket_read(bb);
> > 
> >     output_data = apr_create_brigade(c->pool);
> >     create_output_data(output_data);
> >     ap_pass_brigade(output_data, output_filters);
> > }
> > 
> > This only works because you know where you are when executing your
> > filter.  This will potentially cause some problems when you are reading
> > request data, because you have no idea how much of the actual filter stack
> > has been setup, nor which connection filters are currently in place.
> 
> ??? Surely an input filter reads when its asked to? I suspect we can get
> away with reading (as far as upper layers are concerned) only when
> asked, but writing at various other moments, too.

Input filters read when ap_get_brigade is called, so when reading headers
and when calling get_client_block.  The former is safe, the latter could
be called by and handler however, and thus we really no longer know what
the filter stack looks like.

> I have to admit that I'm less familiar with input filters than output
> ones at this time - is there a nice simple example? Should I write one?

Take a look at www.ntrnet.net/~rbb.  Look for mod_apachecon.  This is a
VERY simple input filter that just reads looking for the first line of a
request.  Then it just goes through and replaces \ with / and ' ' with %20
in the URI.  That is the simplest we get.  For more detailed examples,
look in http_protocol for the HTTP_IN filter.

I'm leaving for the day, I'll be back at my computer later tonight though.

Ryan


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message