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
*) 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]
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.
<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>
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
};
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;
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;