Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 5567 invoked by uid 500); 12 Oct 2001 18:17:00 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 5544 invoked from network); 12 Oct 2001 18:17:00 -0000 Date: Fri, 12 Oct 2001 11:17:03 -0700 (PDT) From: Dirk-Willem van Gulik X-X-Sender: dirkx@titatovenaar.sfo.covalent.net To: dev@httpd.apache.org Subject: Portign 1.3 modules - should I still use handlers ? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N While porting a 1.3 module to 2.0 - which is totally handler based; I used to have: static const handler_rec s99_handlers[] = { {"s99hk", s99_hk_handler}, {"s99get", s99_get_handler}, {"s99cadget", s99_cadget_handler}, .......... {NULL, NULL} }; and now in 2.0 I am doing: static void register_hooks(apr_pool_t *p) { ap_hook_handler(s99_hk_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(s99_get_handler, NULL, NULL, APR_HOOK_MIDDLE); .... static int s99_hk_handler(...) { struct s99_module_data * m = ap_get_module.. ..... if (strcmp(r->handler, "s99hk")) return DECLINED; static int s99_get_handler(...) { struct s99_module_data * m = ap_get_module.. ..... if (strcmp(r->handler, "s99get")) return DECLINED; Now is this the right thing to do ? i.e. have apache go into each of the handlers and ask it wether it wants to run or decline. Or is there a way I can keep this deceision process closer to the core in some tight inner loop ? Or to ask the question in other words - are handlers still the right thing to use for this sort of 'fan out' handling or is there another technique more optimal in 2.0 ? Dw