httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel L. Rall" <...@apache.org>
Subject [PATCH] clarify return value of hook functions used in request processing
Date Sat, 10 Sep 2005 01:50:20 GMT
This is a code-clarity improvement only.


* server/request.c
  (ap_process_request_internal): Check the return value of hook
   functions against the constant OK -- defined in httpd.conf as
   "Module has handled this stage" -- instead of against the magic
   number 0 to improve clarity.



Index: server/request.c
===================================================================
--- server/request.c	(revision 279930)
+++ server/request.c	(working copy)
@@ -186,12 +186,12 @@
         switch (ap_satisfies(r)) {
         case SATISFY_ALL:
         case SATISFY_NOSPEC:
-            if ((access_status = ap_run_access_checker(r)) != 0) {
+            if ((access_status = ap_run_access_checker(r)) != OK) {
                 return decl_die(access_status, "check access", r);
             }
 
             if (ap_some_auth_required(r)) {
-                if (((access_status = ap_run_check_user_id(r)) != 0)
+                if (((access_status = ap_run_check_user_id(r)) != OK)
                     || !ap_auth_type(r)) {
                     return decl_die(access_status, ap_auth_type(r)
                                   ? "check user.  No user file?"
@@ -199,7 +199,7 @@
                                   r);
                 }
 
-                if (((access_status = ap_run_auth_checker(r)) != 0)
+                if (((access_status = ap_run_auth_checker(r)) != OK)
                     || !ap_auth_type(r)) {
                     return decl_die(access_status, ap_auth_type(r)
                                   ? "check access.  No groups file?"
@@ -210,12 +210,12 @@
             break;
 
         case SATISFY_ANY:
-            if (((access_status = ap_run_access_checker(r)) != 0)) {
+            if (((access_status = ap_run_access_checker(r)) != OK)) {
                 if (!ap_some_auth_required(r)) {
                     return decl_die(access_status, "check access", r);
                 }
 
-                if (((access_status = ap_run_check_user_id(r)) != 0)
+                if (((access_status = ap_run_check_user_id(r)) != OK)
                     || !ap_auth_type(r)) {
                     return decl_die(access_status, ap_auth_type(r)
                                   ? "check user.  No user file?"
@@ -223,7 +223,7 @@
                                   r);
                 }
 
-                if (((access_status = ap_run_auth_checker(r)) != 0)
+                if (((access_status = ap_run_auth_checker(r)) != OK)
                     || !ap_auth_type(r)) {
                     return decl_die(access_status, ap_auth_type(r)
                                   ? "check access.  No groups file?"
@@ -238,11 +238,11 @@
      * in mod-proxy for r->proxyreq && r->parsed_uri.scheme
      *                              && !strcmp(r->parsed_uri.scheme, "http")
      */
-    if ((access_status = ap_run_type_checker(r)) != 0) {
+    if ((access_status = ap_run_type_checker(r)) != OK) {
         return decl_die(access_status, "find types", r);
     }
 
-    if ((access_status = ap_run_fixups(r)) != 0) {
+    if ((access_status = ap_run_fixups(r)) != OK) {
         return access_status;
     }
 


Mime
View raw message