httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject svn commit: r369124 - in /httpd/httpd/trunk/modules/aaa: mod_authz_core.c mod_authz_default.c
Date Sun, 15 Jan 2006 00:26:22 GMT
Author: bnicholes
Date: Sat Jan 14 16:26:20 2006
New Revision: 369124

URL: http://svn.apache.org/viewcvs?rev=369124&view=rev
Log:
eliminate the import of the ap_satisfies optional function on every request.  Just import
it once if it exists.

Modified:
    httpd/httpd/trunk/modules/aaa/mod_authz_core.c
    httpd/httpd/trunk/modules/aaa/mod_authz_default.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authz_core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/aaa/mod_authz_core.c?rev=369124&r1=369123&r2=369124&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authz_core.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authz_core.c Sat Jan 14 16:26:20 2006
@@ -592,8 +592,6 @@
     authz_provider_list *current_provider;
     const char *note = apr_table_get(r->notes, AUTHZ_ACCESS_PASSED_NOTE);
 
-    ap_satisfies = APR_RETRIEVE_OPTIONAL_FN(ap_satisfies);
-
     /* If we're not really configured for providers, stop now. */
     if (!conf->providers) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
@@ -667,11 +665,17 @@
     return req_authz;
 }
 
+static void ImportAuthzCoreOptFn(void)
+{
+    ap_satisfies = APR_RETRIEVE_OPTIONAL_FN(ap_satisfies);
+}
+
 static void register_hooks(apr_pool_t *p)
 {
     APR_REGISTER_OPTIONAL_FN(authz_some_auth_required);
 
     ap_hook_auth_checker(authorize_user, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_optional_fn_retrieve(ImportAuthzCoreOptFn,NULL,NULL,APR_HOOK_MIDDLE);
 }
 
 module AP_MODULE_DECLARE_DATA authz_core_module =

Modified: httpd/httpd/trunk/modules/aaa/mod_authz_default.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/aaa/mod_authz_default.c?rev=369124&r1=369123&r2=369124&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authz_default.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authz_default.c Sat Jan 14 16:26:20 2006
@@ -60,12 +60,13 @@
                                                  &authz_default_module);
     const char *note = apr_table_get(r->notes, AUTHZ_ACCESS_PASSED_NOTE);
 
-    ap_satisfies = APR_RETRIEVE_OPTIONAL_FN(ap_satisfies);
+    /* If we got here and access checker passed, assume access is OK */
+    if (note && (note[0] == 'Y') && (ap_satisfies(r) == SATISFY_ANY)) {
+        return OK;
+    }
 
-    /* If we got here and there isn't any authz required and there is no
-       note from the access checker that it failed, assume access is OK */
-    if (!ap_some_auth_required(r) || 
-        (note && (note[0] == 'Y') && (ap_satisfies(r) == SATISFY_ANY))) {
+    /* If we got here and there isn't any authz required, assume access is OK */
+    if (!ap_some_auth_required(r)) {
         return OK;
     }
 
@@ -88,9 +89,15 @@
     return HTTP_UNAUTHORIZED;
 }
 
+static void ImportAuthzDefOptFn(void)
+{
+    ap_satisfies = APR_RETRIEVE_OPTIONAL_FN(ap_satisfies);
+}
+
 static void register_hooks(apr_pool_t *p)
 {
     ap_hook_auth_checker(check_user_access,NULL,NULL,APR_HOOK_LAST);
+    ap_hook_optional_fn_retrieve(ImportAuthzDefOptFn,NULL,NULL,APR_HOOK_MIDDLE);
 }
 
 module AP_MODULE_DECLARE_DATA authz_default_module =



Mime
View raw message