</summary>
- <directivesynopsis>
- <name>H2Engine</name>
- <description>H2 Engine Operation Switch</description>
- <syntax>H2Engine on|off</syntax>
- <default>H2Engine off</default>
- <contextlist>
- <context>server config</context>
- <context>virtual host</context>
- </contextlist>
-
- <usage>
- <p>
- This directive toggles the usage of the HTTP/2 Protocol Engine. This
- should be used inside a
- <directive module="core" type="section">VirtualHost</directive>
- section to enable HTTP/2 for that virtual host. By default the
- HTTP/2 Protocol Engine is disabled for both the main server and all
- configured virtual hosts.
- </p>
- <example><title>Example</title>
- <highlight language="config">
-<VirtualHost _default_:443>
- H2Engine on
- #...
-</VirtualHost>
- </highlight>
- </example>
- <p>
- The HTTP/2 engine is usable in TLS and plain scenarios, supporting
- the 'h2' and 'h2c' variants of the protocol.
- </p>
- </usage>
- </directivesynopsis>
-
<directivesynopsis>
<name>H2Direct</name>
<description>H2 Direct Protocol Switch</description>
static h2_config defconf = {
"default",
- 0, /* enabled */
100, /* max_streams */
16 * 1024, /* max_hl_size */
64 * 1024, /* window_size */
strcat(name, "]");
conf->name = name;
- conf->h2_enabled = DEF_VAL;
conf->h2_max_streams = DEF_VAL;
conf->h2_max_hl_size = DEF_VAL;
conf->h2_window_size = DEF_VAL;
strcat(name, "]");
n->name = name;
- n->h2_enabled = H2_CONFIG_GET(add, base, h2_enabled);
n->h2_max_streams = H2_CONFIG_GET(add, base, h2_max_streams);
n->h2_max_hl_size = H2_CONFIG_GET(add, base, h2_max_hl_size);
n->h2_window_size = H2_CONFIG_GET(add, base, h2_window_size);
int h2_config_geti(h2_config *conf, h2_config_var_t var)
{
switch(var) {
- case H2_CONF_ENABLED:
- return H2_CONFIG_GET(conf, &defconf, h2_enabled);
case H2_CONF_MAX_STREAMS:
return H2_CONFIG_GET(conf, &defconf, h2_max_streams);
case H2_CONF_MAX_HL_SIZE:
}
-static const char *h2_conf_set_engine(cmd_parms *parms,
- void *arg, const char *value)
-{
- h2_config *cfg = h2_config_sget(parms->server);
- if (!strcasecmp(value, "On")) {
- cfg->h2_enabled = 1;
- return NULL;
- }
- else if (!strcasecmp(value, "Off")) {
- cfg->h2_enabled = 0;
- return NULL;
- }
-
- (void)arg;
- return "value must be On or Off";
-}
-
static const char *h2_conf_set_max_streams(cmd_parms *parms,
void *arg, const char *value)
{
#pragma GCC diagnostic ignored "-Wmissing-braces"
const command_rec h2_cmds[] = {
- AP_INIT_TAKE1("H2Engine", h2_conf_set_engine, NULL,
- RSRC_CONF, "on to enable HTTP/2 protocol handling"),
AP_INIT_TAKE1("H2MaxSessionStreams", h2_conf_set_max_streams, NULL,
RSRC_CONF, "maximum number of open streams per session"),
AP_INIT_TAKE1("H2WindowSize", h2_conf_set_window_size, NULL,