httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Sun, 27 Jan 2002 23:28:50 GMT

> There are two ways to do it.
>
> 1)  Do exactly what I told you to do when I committed the patch
> originally.  Let's take an example of SSL.  Your SSL vhost must know
> which socket it is on, because it can't be on a plain HTTP socket.  So,
> for that socket, you replace the accept_function, and that allows you to
> use your own create_conn hook to create the connection and insert your
> own filters for the bottom of the stack.  In fact, regardless of what
> you are configuring, if you are creating a vhost that doesn't speak
> plain HTTP, you must know which socket you are listening on, and you can
> do exactly what you want.
>
An SSL socket is a normal BSD socket for the purposed of accept(). No distinction is made,
so this suggestion isn't sufficient to solve the problem.

> 2)  Ignore this patch, and do what you would do if it wasn't there,
> which I presume is to add another filter above the CORE_IN and CORE
> filters so that they are never called.  That will work just fine with
> this patch in place.

Partially true. I was adding the SSL_IN/SSL_OUT filters in pre_connection which no longer
has access to the socket because it is hidden away in the core_net_rec structure. Relying
on the hack is not a cool way to do this. There were some other things broken with this as
well that I don't have time to get into.  Also, adding core in/out filters in the
pre_connection hook is just wrong. I have a suggestion to fix this.

I think this suggestion should make everyone happy:
Leave ap_new_connection() in place, do NOT pass in the csd though (and remove
client_socket from conn_rec). Create a new hook that runs immediately before the
pre_connection hook (and after ap_update_vhost_given_ip(), I think that is the
function...). This new hook is a RUN_FIRST hook that installs the desired network io
filter (CORE_IN, CORE_OUT, SSL_IN, SSL_OUT whatever). Need to pass this hook the csd and
conn_rec. The difference between this new hook and pre_connection hook is that the new
hook is a RUN_FIRST hook. This will guarantee that one and only one network i/o filter
will ever get installed. The new hook allocates and inits the core_net_rec to maintain the
client socket. This is -very- close to your original patch.

Could name the new hook install_networkio or something like that. If you like this idea, I
will implement it tonight.

Bill

>
> Ryan
>
> ----------------------------------------------
> Ryan Bloom                  rbb@covalent.net
> 645 Howard St.              rbb@apache.org
> San Francisco, CA
>
> > -----Original Message-----
> > From: Bill Stoddard [mailto:bill@wstoddard.com]
> > Sent: Sunday, January 27, 2002 12:55 PM
> > To: dev@httpd.apache.org; rbb@covalent.net
> > Subject: Re: cvs commit: httpd-2.0/server/mpm/worker worker.c
> >
> > Ryan, you are vetoing my veto.  Consider this patch a veto of your
> 11/12
> > patch. I am open
> > to suggestions to determine a compromise.
> >
> > I need to replace core_in and core_out based on configuration. How can
> I
> > do that with your
> > patch in place?
> >
> > Bill
> >
> >
> > ----- Original Message -----
> > From: "Ryan Bloom" <rbb@covalent.net>
> > To: <dev@httpd.apache.org>; <httpd-2.0-cvs@apache.org>
> > Sent: Sunday, January 27, 2002 3:05 PM
> > Subject: RE: cvs commit: httpd-2.0/server/mpm/worker worker.c
> >
> >
> > > > stoddard    02/01/27 04:52:08
> > > >
> > > >   Modified:    .        CHANGES
> > > >                include  http_connection.h httpd.h
> > > >                modules/http http_core.c
> > > >                modules/proxy proxy_ftp.c proxy_http.c
> > > >                server   connection.c core.c
> > > >                server/mpm/beos beos.c
> > > >                server/mpm/mpmt_os2 mpmt_os2_child.c
> > > >                server/mpm/netware mpm_netware.c
> > > >                server/mpm/perchild perchild.c
> > > >                server/mpm/prefork prefork.c
> > > >                server/mpm/winnt mpm_winnt.c
> > > >                server/mpm/worker worker.c
> > > >   Log:
> > > >   Remove the create_connection hook and put the client_socket back
> > > into
> > > > the
> > > >   conn_rec. The create_connection_hook has a design flaw that
> prevents
> > > it
> > > >   from making decisions based on vhost information.
> > >
> > > -1.  You can't back out a patch because it doesn't do something it
> > > wasn't designed to do!  That hook was meant to allow different
> filters
> > > to be added based on the connection used, not based on the
> > > configuration.  If you want to do something based on the
> configuration,
> > > you have to wait until the request has been read.  Removing the
> socket
> > > from the conn_rec has all sorts of advantages, not the least being
> that
> > > it keeps people from using the socket without going through filters.
> > >
> > > Ryan
> > >
> > >
> > >
>
>


Mime
View raw message