httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1037140 - in /httpd/httpd/trunk: modules/aaa/mod_authz_core.c modules/filters/mod_filter.c modules/loggers/mod_log_config.c modules/metadata/mod_headers.c modules/ssl/ssl_engine_config.c server/core.c server/util_expr_eval.c
Date Sat, 20 Nov 2010 08:59:51 GMT
Author: sf
Date: Sat Nov 20 08:59:50 2010
New Revision: 1037140

URL: http://svn.apache.org/viewvc?rev=1037140&view=rev
Log:
Log errors/infos during expression evaluation and associate the message
with the module that is calling ap_expr_exec()

Modified:
    httpd/httpd/trunk/modules/aaa/mod_authz_core.c
    httpd/httpd/trunk/modules/filters/mod_filter.c
    httpd/httpd/trunk/modules/loggers/mod_log_config.c
    httpd/httpd/trunk/modules/metadata/mod_headers.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
    httpd/httpd/trunk/server/core.c
    httpd/httpd/trunk/server/util_expr_eval.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authz_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authz_core.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authz_core.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authz_core.c Sat Nov 20 08:59:50 2010
@@ -1008,6 +1008,7 @@ static const char *expr_parse_config(cmd
     if (expr_err)
         return "Cannot parse expression in require line";
 
+    expr->module_index = APLOG_MODULE_INDEX;
     *parsed_require_line = expr;
 
     return NULL;

Modified: httpd/httpd/trunk/modules/filters/mod_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_filter.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_filter.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_filter.c Sat Nov 20 08:59:50 2010
@@ -433,6 +433,7 @@ static const char *filter_provider(cmd_p
                            "Error parsing FilterProvider expression:", err,
                            NULL);
     }
+    node->module_index = APLOG_MODULE_INDEX;
 
     provider = apr_palloc(cmd->pool, sizeof(ap_filter_provider_t));
     provider->expr = node;

Modified: httpd/httpd/trunk/modules/loggers/mod_log_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_config.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_log_config.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_log_config.c Sat Nov 20 08:59:50 2010
@@ -1256,6 +1256,7 @@ static const char *add_custom_log(cmd_pa
                                                     NULL);
             if (err)
                 return err;
+	    cls->condition_expr->module_index = APLOG_MODULE_INDEX;
         }
         else {
             return "error in condition clause";

Modified: httpd/httpd/trunk/modules/metadata/mod_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_headers.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_headers.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_headers.c Sat Nov 20 08:59:50 2010
@@ -498,6 +498,7 @@ static APR_INLINE const char *header_ino
                                    "Can't parse envclause/expression: ", err,
                                    NULL);
             }
+            expr->module_index = APLOG_MODULE_INDEX;
         }
     }
 

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_config.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_config.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_config.c Sat Nov 20 08:59:50 2010
@@ -1154,6 +1154,7 @@ const char *ssl_cmd_SSLRequire(cmd_parms
     info->flags = AP_EXPR_FLAGS_SSL_EXPR_COMPAT;
     info->filename = cmd->directive->filename;
     info->line_number = cmd->directive->line_num;
+    info->module_index = APLOG_MODULE_INDEX;
     errstring = ap_expr_parse(cmd->pool, cmd->temp_pool, info, arg, NULL);
     if (errstring) {
         return apr_pstrcat(cmd->pool, "SSLRequire: ", errstring, NULL);

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Sat Nov 20 08:59:50 2010
@@ -2043,6 +2043,7 @@ static const char *ifsection(cmd_parms *
     if (expr_err) {
         return apr_psprintf(cmd->pool, "Cannot parse condition clause: %s", expr_err);
     }
+    conf->condition->module_index = APLOG_MODULE_INDEX;
 
     errmsg = ap_walk_config(cmd->directive->first_child, cmd, new_file_conf);
     if (errmsg != NULL)

Modified: httpd/httpd/trunk/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1037140&r1=1037139&r2=1037140&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c (original)
+++ httpd/httpd/trunk/server/util_expr_eval.c Sat Nov 20 08:59:50 2010
@@ -687,10 +687,18 @@ AP_DECLARE(int) ap_expr_exec(request_rec
 
     *err = NULL;
     rc = ap_expr_eval(&ctx, info->root_node);
-    if (*err != NULL)
-        return (-1);
-    else
-        return (rc ? 1 : 0);
+    if (*err != NULL) {
+        ap_log_rerror(__FILE__, __LINE__, info->module_index, APLOG_ERR, 0,
+                      r, "Evaluation of expression from %s:%d failed: %s",
+                      info->filename, info->line_number, *err);
+        return -1;
+    } else {
+        rc = rc ? 1 : 0;
+        ap_log_rerror(__FILE__, __LINE__, info->module_index, APLOG_TRACE4, 0,
+                      r, "Evaluation of expression from %s:%d gave: %d",
+                      info->filename, info->line_number, rc);
+        return rc;
+    }
 }
 
 static const char *req_table_func(ap_expr_eval_ctx *ctx, const void *data,



Mime
View raw message