Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2805195DC for ; Tue, 26 Jun 2012 01:49:34 +0000 (UTC) Received: (qmail 75817 invoked by uid 500); 26 Jun 2012 01:49:33 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 75776 invoked by uid 500); 26 Jun 2012 01:49:33 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 75766 invoked by uid 99); 26 Jun 2012 01:49:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 01:49:33 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=FH_FAKE_RCVD_LINE_B,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ohaya@cox.net designates 68.230.241.216 as permitted sender) Received: from [68.230.241.216] (HELO eastrmfepo201.cox.net) (68.230.241.216) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 01:49:24 +0000 Received: from eastrmimpo306.cox.net ([68.230.241.238]) by eastrmfepo201.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20120626014903.IXKZ5450.eastrmfepo201.cox.net@eastrmimpo306.cox.net> for ; Mon, 25 Jun 2012 21:49:03 -0400 Received: from eastrmwml213 ([172.18.18.217]) by eastrmimpo306.cox.net with bizsmtp id Spp31j0064h0NJL02pp3fS; Mon, 25 Jun 2012 21:49:03 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020204.4FE9150F.0077,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=1.1 cv=N8zFU5CHDTM7QisxlwKHOE9wqdjv1Q5k7nW6hLv0xu4= c=1 sm=1 a=CDNqrPQBvPcA:10 a=G8Uczd0VNMoA:10 a=X0LLrcwhTTAA:10 a=IkcTkHD0fZMA:10 a=TRy/vagDvAN6zvr8h90PzQ==:17 a=9FbFtp_GB3XQjYhJdxsA:9 a=QEXdDO2ut3YA:10 a=TRy/vagDvAN6zvr8h90PzQ==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: from 72.192.248.102 by webmail.east.cox.net; Mon, 25 Jun 2012 21:49:03 -0400 Message-ID: <20120625214903.P4S9J.232004.imail@eastrmwml213> Date: Mon, 25 Jun 2012 21:49:03 -0400 From: To: modules-dev@httpd.apache.org Subject: Confused about modules processing order... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) Sensitivity: Normal Hi, I have my small prototype module, which I implemented starting with the mod_headers.c source, working. The changes that I did to the original source were to add some code in the insert_filter hook to inject an additional header into the request. That seems to work ok with a "vanilla" Apache configuration. I want to be able to make my modified module work together with another module, provided by Oracle (the Oracle Access Manager webgate, aka "webgate"). However, after I add the directives into the Apache httpd.conf to enable the webgate, it appears that, on incoming requests, the webgate processing occurs, but my code in the modified mod_headers module is not called at all :(!! Here's the last part of my modified mod_headers.c: static void register_hooks(apr_pool_t *p) { printf("mod_headers-jl V0.13 - use LIBCURL instead of OAM ASDK-process response from callCurl\n"); printf("In register_hooks\n"); ap_register_output_filter("FIXUP_HEADERS_OUT", ap_headers_output_filter, NULL, AP_FTYPE_CONTENT_SET); ap_register_output_filter("FIXUP_HEADERS_ERR", ap_headers_error_filter, NULL, AP_FTYPE_CONTENT_SET); ap_hook_pre_config(header_pre_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_post_config(header_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_insert_filter(ap_headers_insert_output_filter, NULL, NULL, APR_HOOK_LAST); ap_hook_insert_error_filter(ap_headers_insert_error_filter, NULL, NULL, APR_HOOK_LAST); ap_hook_fixups(ap_headers_fixup, NULL, NULL, APR_HOOK_LAST); ap_hook_post_read_request(ap_headers_early, NULL, NULL, APR_HOOK_FIRST); } module AP_MODULE_DECLARE_DATA headers_module = { STANDARD20_MODULE_STUFF, create_headers_dir_config, /* dir config creater */ merge_headers_config, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server configs */ headers_cmds, /* command apr_table_t */ register_hooks /* register hooks */ }; The code I added is in the "ap_headers_insert_output_filter()" function. I did an "export SHOW_HOOKS=1" and ran the Apache, and I see this for the modified mod_headers: Registering hooks for mod_headers.c mod_headers-jl V0.13 - use LIBCURL instead of OAM ASDK-process response from callCurl In register_hooks Hooked pre_config Hooked post_config Hooked insert_filter Hooked insert_error_filter Hooked fixups Hooked post_read_request And for webgate, I see: Registering hooks for apache2entry_web_gate.cpp Hooked post_config Hooked handler Hooked check_user_id Hooked auth_checker I thought that the handler functions are called almost last part of the processing (content generation), and my code is hooked to insert_filter, which I thought occurs earlier than content generation, so shouldn't my code get processed BEFORE Apache attempts to process the webgate functions? How can I get my code to process before the webgate does? Thanks, Jim