You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/07/02 09:32:27 UTC

svn commit: r1142163 - in /httpd/httpd/trunk: docs/manual/expr.xml server/util_expr_eval.c

Author: sf
Date: Sat Jul  2 07:32:26 2011
New Revision: 1142163

URL: http://svn.apache.org/viewvc?rev=1142163&view=rev
Log:
Add REQUEST_STATUS variable to ap_expr

Modified:
    httpd/httpd/trunk/docs/manual/expr.xml
    httpd/httpd/trunk/server/util_expr_eval.c

Modified: httpd/httpd/trunk/docs/manual/expr.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/expr.xml?rev=1142163&r1=1142162&r2=1142163&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/expr.xml (original)
+++ httpd/httpd/trunk/docs/manual/expr.xml Sat Jul  2 07:32:26 2011
@@ -226,6 +226,8 @@ listfunction ::= listfuncname "<strong>(
     <tr><td><code>IPV6</code></td>
         <td>"<code>on</code>" if the connection uses IPv6,
             "<code>off</code>" otherwise</td></tr>
+    <tr><td><code>REQUEST_STATUS</code></td>
+        <td>The HTTP error status of the request<td></tr>
     <tr><td><code>REQUEST_LOG_ID</code></td>
         <td>The error log id of the request (see
             <directive module="core">ErrorLogFormat</directive>)</td></tr>

Modified: httpd/httpd/trunk/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1142163&r1=1142162&r2=1142163&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c (original)
+++ httpd/httpd/trunk/server/util_expr_eval.c Sat Jul  2 07:32:26 2011
@@ -1080,6 +1080,7 @@ static const char *request_var_names[] =
     "LAST_MODIFIED",            /* 24 */
     "CONTEXT_PREFIX",           /* 25 */
     "CONTEXT_DOCUMENT_ROOT",    /* 26 */
+    "REQUEST_STATUS",           /* 27 */
     NULL
 };
 
@@ -1163,6 +1164,8 @@ static const char *request_var_fn(ap_exp
         return ap_context_prefix(r);
     case 26:
         return ap_context_document_root(r);
+    case 27:
+        return r->status ? apr_psprintf(ctx->p, "%d", r->status) : "";
     default:
         ap_assert(0);
         return NULL;