From: Stefan Eissing Date: Mon, 24 Aug 2015 09:26:17 +0000 (+0000) Subject: changed Protocols to let vhosts override servers, removed old H2Engine example from... X-Git-Tag: 2.5.0-alpha~2929 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e586ad099faa90db55fbc202d55b7e8e5df0b393;p=apache changed Protocols to let vhosts override servers, removed old H2Engine example from readme git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1697339 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index f3eb55ce79..8455834303 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -3740,11 +3740,11 @@ Protocol https

It is safe to specify protocols that are unavailable/disabled. Such protocol names will simply be ignored.

-

Protocols specified in base servers and virtual hosts are concatenated - by appending the base ones, if there are configured protocols, - to the virtual host ones. Since protocols such as HTTP/2 allow - connection reuse under certain conditions, restricting protocols for - individual virtual hosts might not work as you expect it to.

+

Protocols specified in base servers are inherited for virtual hosts + only if the virtual host has no own Protocols directive. Or, the other + way around, Protocols directives in virtual hosts replace any + such directive in the base server. +

ProtocolsHonorOrder diff --git a/modules/http2/README.h2 b/modules/http2/README.h2 index dc56a251c2..803f787f9a 100644 --- a/modules/http2/README.h2 +++ b/modules/http2/README.h2 @@ -34,13 +34,26 @@ shared cousins. CONFIGURATION -The most important configuration options is - - H2Engine On|Off - -which can be set on the base server or a virtual host. By default, the -engine is 'Off'. Please see the documentation of mod_h2 for a complete -list and explanation of other options. +If mod_h2 is enabled for a site or not depends on the new "Protocols" +directive. This directive list all protocols enabled for a server or +virtual host. + +If you do not specify "Protocols" all available protocols are enabled. For +sites using TLS, the protocol supported by mod_h2 is "h2". For cleartext +http:, the offered protocol is "h2c". + +The following is an example of a server that only supports http/1.1 in +general and offers h2 for a specific virtual host. + + ... + Protocols http/1.1 + + Protocols h2 http/1.1 + ... + + +Please see the documentation of mod_h2 for a complete list and explanation +of all options. TLS CONFIGURATION diff --git a/server/core.c b/server/core.c index 909ada6282..2c23dff99b 100644 --- a/server/core.c +++ b/server/core.c @@ -554,7 +554,8 @@ static void *merge_core_server_configs(apr_pool_t *p, void *basev, void *virtv) ? virt->merge_trailers : base->merge_trailers; - conf->protocols = apr_array_append(p, virt->protocols, base->protocols); + conf->protocols = ((virt->protocols->nelts > 0)? + virt->protocols : base->protocols); conf->protocols_honor_order = ((virt->protocols_honor_order < 0)? base->protocols_honor_order : virt->protocols_honor_order);