Commit eb1e18d2 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1726167 from trunk:

expr support for HTTP2 variable
Submitted by: icing
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1735769 13f79535-47bb-0310-9956-ffa450edef68
parent d8bc89b2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
  *) mod_reqtimeout: Prevent long response times from triggering a timeout once
     the request has been fully read.  PR 59045.  [Yann Ylavic]

  *) ap_expr: expression support for variable HTTP2=on|off. [Stefan Eissing]
     
  *) mod_http2: give control to async mpm for keepalive timeouts only when
     no streams are open and even if only after 1 sec delay. Under load, event
     mpm discards connections otherwise too quickly. [Stefan Eissing]
+0 −5
Original line number Diff line number Diff line
@@ -112,11 +112,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) ap_expr: expression support for variable HTTP2=on|off
     trunk patch: http://svn.apache.org/r1726167
     2.4.x patch: https://eissing.org/expr_http2_2.4.patch
     +1: icing, ylavic, trawick

  *) mod_ssl: Free dhparams when getting DH params. This fixes issue when
     SSLCryptoDevice does not get unregistered because of non-zero refcount
     during the mod_ssl unload happening on httpd startup.
+3 −0
Original line number Diff line number Diff line
@@ -254,6 +254,9 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
    <tr><td><code>HANDLER</code></td>
        <td>The name of the <a href="handler.html">handler</a> creating
            the response</td></tr>
    <tr><td><code>HTTP2</code></td>
        <td>"<code>on</code>" if the request uses http/2,
            "<code>off</code>" otherwise</td></tr>
    <tr><td><code>HTTPS</code></td>
        <td>"<code>on</code>" if the request uses https,
            "<code>off</code>" otherwise</td></tr>
+10 −0
Original line number Diff line number Diff line
@@ -1254,11 +1254,15 @@ static int op_file_subr(ap_expr_eval_ctx_t *ctx, const void *data, const char *a
APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *));
static APR_OPTIONAL_FN_TYPE(ssl_is_https) *is_https = NULL;

APR_DECLARE_OPTIONAL_FN(int, http2_is_h2, (conn_rec *));
static APR_OPTIONAL_FN_TYPE(http2_is_h2) *is_http2 = NULL;

static const char *conn_var_names[] = {
    "HTTPS",                    /*  0 */
    "IPV6",                     /*  1 */
    "CONN_LOG_ID",              /*  2 */
    "CONN_REMOTE_ADDR",         /*  3 */
    "HTTP2",                    /*  4 */
    NULL
};

@@ -1292,6 +1296,11 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
        return c->log_id;
    case 3:
        return c->client_ip;
    case 4:
        if (is_http2 && is_http2(c))
            return "on";
        else
            return "off";
    default:
        ap_assert(0);
        return NULL;
@@ -1782,6 +1791,7 @@ static int ap_expr_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                               apr_pool_t *ptemp, server_rec *s)
{
    is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https);
    is_http2 = APR_RETRIEVE_OPTIONAL_FN(http2_is_h2);
    apr_pool_cleanup_register(pconf, &is_https, ap_pool_cleanup_set_null,
                              apr_pool_cleanup_null);
    return OK;