Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 64110 invoked by uid 500); 28 Nov 2000 22:20:18 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 64027 invoked from network); 28 Nov 2000 22:20:14 -0000 Date: Tue, 28 Nov 2000 14:21:51 -0800 (PST) From: rbb@covalent.net X-Sender: rbb@koj.rkbloom.net To: "new-httpd@apache.org" Subject: Re: Question about hooks in mod_include. In-Reply-To: <3A2428FE.E09A2C24@raleigh.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N You have the idea correct mostly. The hook is used to allow modules to register their functions with the hash table. The reason for the hook, is that it makes things a bit clearer for the module writers. Basically, if mod_include just exports the function, then when do include_modules call that function? The explicit hook just makes it very obvious as to when those functions should be registered. Ryan On Tue, 28 Nov 2000, Paul J. Reder wrote: > Ryan, > > You mentioned using hooks in mod_include (ala experimental/mod_cache) to allow > modules to register handle_x functions with mod_include. > > I am confused by this for the following reason. As I understand it, this would > create a hook list of module functions that mod_include would run (via > ap_run_hook...) when it found an SSI. Each registered hook function would get > a shot until one of them handled the SSI. > > This doesn't allow for the registration with mod_include of a hashable "directive > token"/handler_x function pair for quick access and extendibility. > > Unless you are talking about something like allowing the modules to register a > hook function early in the process which will perform the directive registration > with mod_include when the hook is run by mod_include later in the init processing. > This seems unnecessarily complex. > > It seems to me that what we need is an exported function in mod_include that > gets called from other modules that would like to register a directive/function > pair (i.e.. register_include_handler("perl", handle_perl); where handle_perl is > a function in the perl code that can handle perl SSI directives). Mod_include would > then insert the function into the hash table using the directive as the key. > > Where am I not understanding the hook code? > > -- > Paul J. Reder > ----------------------------------------------------------- > "The strength of the Constitution lies entirely in the determination of each > citizen to defend it. Only if every single citizen feels duty bound to do > his share in this defense are the constitutional rights secure." > -- Albert Einstein > > _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------