httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: SSL support
Date Sun, 04 Feb 2001 17:16:34 GMT
rbb@covalent.net wrote:
> 
> > > > However, I've immediately hit a problem - SSL requires the ability to
> > > > write when its reading and read when its writing, if you see what I
> > > > mean. Now, I really wanted to slot it in as a filter, which means that
> > > > the read filter has to be able to send stuff to the write filter chain
> > > > (well, insert stuff, more to the point) and vice versa. I can't
> > > > immediately see how that's possible, if it is at all. Is it? Should it
> > > > be?
> > >
> > > I don't understand what you want to do.  Do you want to write something to
> > > the socket as you are reading, or do you want to setup some data to be
> > > written as you start to write the output?
> > >
> > > If the latter, just delay inserting the output_filter until you are in the
> > > input filter, and then you can insert the output filter with a ctx pointer
> > > that has the data you want to write.
> >
> > Unfortunately, its the former :-) And vice versa (hmm ... just possibly
> > we can get away with not doing this variant, actually). And it goes on
> > all the time, not just at startup.
> 
> Okay, so why can't you just do that.  What I mean is something like the
> following in your input filter (and conversly in the output filter)
> 
> apr_status_t ssl_input_filter(ap_filter_t *f, apr_brigade *bb)
> {
> 
>     ap_bucket *b = APR_BRIGADE_LAST(bb);
>     ap_bucket_socket *bs = b->data;
> 
> 
>     if (APR_BUCKET_IS_SOCKET(b)) {
>         ap_bucket_read(...);
>         apr_send(bs->socket, ...);
>     }
> }
> 
> The idea is above, but the names are almost definately wrong.
>
>  You are
> writing a filter at a level low-enough that you will need to actually get
> information out of the bucket itself.

I was noticing as I went along all these filters that know stuff about
the next/previous filter in the chain. I can't say I'm very keen on
that.

But why can't I just write it to the next filter in the normal way,
instead of direct to the socket? That is, write to the next _output_
filter from my _input_ filter?

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Mime
View raw message