]> granicus.if.org Git - apache/commitdiff
core: Add post_perdir_config hook.
authorGraham Leggett <minfrin@apache.org>
Mon, 10 Jun 2013 14:41:34 +0000 (14:41 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 10 Jun 2013 14:41:34 +0000 (14:41 +0000)
trunk patch: http://svn.apache.org/r1368121
Submitted by: minfrin
Reviewed by: jim, sf

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1491472 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
include/ap_mmn.h
include/http_request.h
server/request.c

diff --git a/CHANGES b/CHANGES
index 90e016f8c6849adcce8e2e74e3c349a4d227f067..8777dd218c278416e4ae4c5acadc32d54465a191 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.5
 
+  *) core: Add post_perdir_config hook.
+     [Steinar Gunderson <sgunderson bigfoot.com>]
+
   *) proxy_util: NULL terminate the right buffer in 'send_http_connect'.
      [Christophe Jaillet]
 
diff --git a/STATUS b/STATUS
index 02bae31df1ff1191fa91dcb28b1fcaa7f48f9420..142cfdc7501bbe186fcb1417f6c45d3c49be1ee2 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -90,11 +90,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
  
-    * core: Add post_perdir_config hook.
-      trunk patch: http://svn.apache.org/r1368121
-      2.4.x patch: trunk patch works modulo CHANGES and mmn bump
-      +1: minfrin, jim, sf
-
     * core: Add dirwalk_stat hook.
       trunk patch: http://svn.apache.org/r1388447
       2.4.x patch: trunk patch works modulo CHANGES and mmn bump
index 1cc221efa63f507123aca8bef4e732962a1764b5..ceced61ce299cf3b4e205be8fea9ac0ac741601f 100644 (file)
  * 20120211.14 (2.4.5-dev) Add ppinherit and inherit to proxy_server_conf
  * 20120211.15 (2.4.5-dev) Add dav_join_error()
  * 20120211.16 (2.4.5-dev) Add cache_control_t.invalidated
- * 20120211.17 (2.5.0-dev) Add ap_find_etag_weak(), ap_find_etag_strong()
- * 20120211.18 (2.5.0-dev) Add ap_condition_e, ap_condition_if_match(),
+ * 20120211.17 (2.4.5-dev) Add ap_find_etag_weak(), ap_find_etag_strong()
+ * 20120211.18 (2.4.5-dev) Add ap_condition_e, ap_condition_if_match(),
  *                         ap_condition_if_unmodified_since(),
  *                         ap_condition_if_none_match(),
  *                         ap_condition_if_modified_since(),
  *                         ap_condition_if_range()
+ * 20120211.19 (2.4.5-dev) Add post_perdir_config hook.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20120211
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 18                   /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 19                   /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index a81e7538b2d089227ee8d0021970c08ad9d05ce6..086e930871fca9804f179a5fc7921bc88c8a49ed 100644 (file)
@@ -528,6 +528,16 @@ AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf,
  */
 AP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
 
+/**
+ * This hook allows modules to affect the request immediately after the
+ * per-directory configuration for the request has been generated.
+ * @param r The current request
+ * @return OK (allow acces), DECLINED (let later modules decide),
+ *         or HTTP_... (deny access)
+ * @ingroup hooks
+ */
+AP_DECLARE_HOOK(int,post_perdir_config,(request_rec *r))
+
 AP_DECLARE(int) ap_location_walk(request_rec *r);
 AP_DECLARE(int) ap_directory_walk(request_rec *r);
 AP_DECLARE(int) ap_file_walk(request_rec *r);
index d26d469116cb67a82e6762f0ef6e8d11c1551df8..4abe99ca76ba833b9f49929ce7764b648eba4c8e 100644 (file)
@@ -69,6 +69,7 @@ APR_HOOK_STRUCT(
     APR_HOOK_LINK(auth_checker)
     APR_HOOK_LINK(insert_filter)
     APR_HOOK_LINK(create_request)
+    APR_HOOK_LINK(post_perdir_config)
 )
 
 AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,
@@ -90,6 +91,8 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,
 AP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
 AP_IMPLEMENT_HOOK_RUN_ALL(int, create_request,
                           (request_rec *r), (r), OK, DECLINED)
+AP_IMPLEMENT_HOOK_RUN_ALL(int, post_perdir_config,
+                          (request_rec *r), (r), OK, DECLINED)
 
 static int auth_internal_per_conf = 0;
 static int auth_internal_per_conf_hooks = 0;
@@ -191,6 +194,10 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r)
         r->log = d->log;
     }
 
+    if ((access_status = ap_run_post_perdir_config(r))) {
+        return access_status;
+    }
+
     /* Only on the main request! */
     if (r->main == NULL) {
         if ((access_status = ap_run_header_parser(r))) {