From d4f921b6e3e471effc197c27ec265a1d18eb2c85 Mon Sep 17 00:00:00 2001 From: Jean-Luc Cyr Date: Tue, 3 Jul 2018 15:24:02 -0400 Subject: [PATCH] split before/after --- mod_absec.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mod_absec.c b/mod_absec.c index 6ca7fce..89bdbf4 100644 --- a/mod_absec.c +++ b/mod_absec.c @@ -86,10 +86,23 @@ static int check_autorization(request_rec *r) return 0; } +//////////////////////////////////////////////////////////////// +/* Main routine */ +static int absec_handler_last(request_rec *r) +{ + // Is this module really called? + if (strcmp(r->handler, "absec")) { + return DECLINED; + } + r->content_type = "text/html"; + //ap_rprintf(r, "The sample page from mod_absec.c %s \n
", r->args); + ap_rprintf(r, "After Url: %s from %s \n
", r->filename, r->uri); + return (OK); +} //////////////////////////////////////////////////////////////// /* Main routine */ -static int absec_handler(request_rec *r) +static int absec_handler_first(request_rec *r) { // Is this module really called? if (strcmp(r->handler, "absec")) { @@ -294,7 +307,8 @@ static int absec_handler(request_rec *r) static void absec_register_hooks(apr_pool_t *p) { //ap_hook_handler(absec_handler, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_handler(absec_handler, NULL, NULL, APR_HOOK_LAST); + ap_hook_handler(absec_handler_last, NULL, NULL, APR_HOOK_LAST); + ap_hook_handler(absec_handler_first, NULL, NULL, APR_HOOK_FIRST); } ////////////////////////////////////////////////////////////////