httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: beta?
Date Sat, 03 Feb 2001 13:34:59 GMT
David Williams wrote:
> 
> > From: Ben Laurie [mailto:ben@algroup.co.uk]
> > > > > James Sutherland wrote:
> > > > > [snip]
> > > > > >
> > > > > > The question is, what "protocol" to use? Just sending a
> > > > struct describing
> > > > > > what's going on is one option; have each process send to a socket
> > > > > > (UDP??) with the monitoring module/process running on?
> > > > >
> > > > > This is solution that works.
> > > > >
> > > > > However, I also miss still a protocol field in the
> > > > > server_rec. If Apache can support multiple protocol
> > > > > via protocol modules it is my opinion that each
> > > > > server ('server_rec') needs to know which protocol
> > > > > it serves.
> > >
> > > Seems that each server does need to know which protocol it is capable of
> > > serving.  And in cases where it supports multiple ones, use the
> > > request_rec->protocol field to determine how to handle that particular
> > > request.
> >
> > Now you've lost me ... a "server" in this context is a binding of an IP
> > address and port - it inherently "knows" what it should do through the
> > configuration (which is derived from that binding).
> 
> I am under the impression that ap_hook_process_connection() was provided to
> allow non-http protocol modules to hook into the processing path?

Yes.

>  So that a
> given server process (e.g. child_main() in prefork.c) could handle multiple
> protocols, which could all be sent to the same port if desired.

How would it know which one to handle, then?

> > > > ?? So how come mod_echo works without one of these?
> > >
> > > mod_echo might not be the best example, since it doesn't care about the
> > > protocol at all, simply echoing what was received.
> >
> > Errr ... and how is this not a protocol? Wouldn't you be a little upset
> > if your webserver thought that's what it should do?
> 
> I meant mod_echo is not a protocol in the sense that it cares about request.
> It would treat
>   GET http://www.foo.org HTTP/1.1
>   METHOD_X  New_Transport_Protocol:Resource_locator  NTP/1.0
> the same and hijack the incoming request.   Where as a more protocol aware
> module would examine the PDU and decline the request if it doesn't
> understand it.  Giving ap_process_http_connection() or other protocol
> modules a chance to handle it.

Ah. You are talking about a protocol of a different kind. Clearly you
have to know in advance that the client is going to select a protocol in
its request - and _that's_ the protocol you handle in
ap_hook_process_connection(). If you then want to hand off to a
sub-protocol you need your own hooking mechanism to do that, I'd say
(which would be dependent on the initial protocol). This would,
presumably, use an optional hook (damn, can I rename generic hooks to
optional hooks without getting shot?).

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