Commit 2c552ea5 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Add REQUEST_STATUS variable to ap_expr


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142163 13f79535-47bb-0310-9956-ffa450edef68
parent fafd44b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -226,6 +226,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</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>
+3 −0
Original line number Diff line number Diff line
@@ -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_expr_eval_ctx_t *ctx, const void *data)
        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;