You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2016/03/09 14:41:16 UTC

svn commit: r1734238 - in /httpd/httpd/trunk: docs/manual/mod/mod_proxy_http2.xml modules/http2/h2_proxy_session.c modules/http2/mod_proxy_http2.c

Author: icing
Date: Wed Mar  9 13:41:16 2016
New Revision: 1734238

URL: http://svn.apache.org/viewvc?rev=1734238&view=rev
Log:
mod_proxy_http2 documentation, addition of request notes proxy-status and proxy-source-port

Added:
    httpd/httpd/trunk/docs/manual/mod/mod_proxy_http2.xml
Modified:
    httpd/httpd/trunk/modules/http2/h2_proxy_session.c
    httpd/httpd/trunk/modules/http2/mod_proxy_http2.c

Added: httpd/httpd/trunk/docs/manual/mod/mod_proxy_http2.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy_http2.xml?rev=1734238&view=auto
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy_http2.xml (added)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy_http2.xml Wed Mar  9 13:41:16 2016
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
+<!-- $LastChangedRevision: 1652400 $ -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<modulesynopsis metafile="mod_proxy_http2.xml.meta">
+
+<name>mod_proxy_http2</name>
+<description>HTTP/2 support module for
+<module>mod_proxy</module></description>
+<status>Extension</status>
+<sourcefile>mod_proxy_http2.c</sourcefile>
+<identifier>proxy_http2_module</identifier>
+
+<summary>
+    <p>This module <em>requires</em> the service of <module
+    >mod_proxy</module>. It provides the features used for
+    proxying HTTP/2 requests. <module>mod_proxy_http2</module>
+    supports HTTP/2 only. It does <em>not</em>
+    provide any downgrades to HTTP/1.1.</p>
+
+    <p>Thus, in order to get the ability of handling HTTP/2 proxy requests,
+    <module>mod_proxy</module> and <module>mod_proxy_http2</module>
+    have to be present in the server.</p>
+
+    <p><module>mod_proxy_http2</module> works with incoming requests
+    over HTTP/1.1 and HTTP/2 requests. If <module>mod_proxy_http2</module>
+    handles the frontend connection, requests against the same HTTP/2
+    backend are sent over a single connection, whenever possible.</p>
+
+    <p>This module relies on <a href="http://nghttp2.org/">libnghttp2</a>
+    to provide the core http/2 engine.</p>
+
+    <note type="warning"><title>Warning</title>
+        <p>This module is experimental. Its behaviors, directives, and 
+        defaults are subject to more change from release to 
+        release relative to other standard modules. Users are encouraged to 
+        consult the "CHANGES" file for potential updates.</p>
+    </note>
+
+    <note type="warning"><title>Warning</title>
+      <p>Do not enable proxying until you have <a
+      href="mod_proxy.html#access">secured your server</a>. Open proxy
+      servers are dangerous both to your network and to the Internet at
+      large.</p>
+    </note>
+</summary>
+<seealso><module>mod_http2</module></seealso>
+<seealso><module>mod_proxy</module></seealso>
+<seealso><module>mod_proxy_connect</module></seealso>
+
+<section id="notes"><title>Request notes</title>
+    <p><module>mod_proxy_http</module> creates the following request notes for
+        logging using the <code>%{VARNAME}n</code> format in
+        <directive module="mod_log_config">LogFormat</directive> or
+        <directive module="core">ErrorLogFormat</directive>:
+    </p>
+    <dl>
+        <dt>proxy-source-port</dt>
+        <dd>The local port used for the connection to the backend server.</dd>
+        <dt>proxy-status</dt>
+        <dd>The HTTP/2 status received from the backend server.</dd>
+    </dl>
+</section>
+
+</modulesynopsis>

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_session.c?rev=1734238&r1=1734237&r2=1734238&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.c Wed Mar  9 13:41:16 2016
@@ -225,8 +225,9 @@ static apr_status_t h2_proxy_stream_add_
 {
     if (n[0] == ':') {
         if (!stream->data_received && !strncmp(":status", n, nlen)) {
-            char *s = apr_pstrndup(stream->pool, v, vlen);
+            char *s = apr_pstrndup(stream->r->pool, v, vlen);
             
+            apr_table_setn(stream->r->notes, "proxy-status", s);
             ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c, 
                           "h2_proxy_stream(%s-%d): got status %s", 
                           stream->session->id, stream->id, s);

Modified: httpd/httpd/trunk/modules/http2/mod_proxy_http2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/mod_proxy_http2.c?rev=1734238&r1=1734237&r2=1734238&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_proxy_http2.c (original)
+++ httpd/httpd/trunk/modules/http2/mod_proxy_http2.c Wed Mar  9 13:41:16 2016
@@ -226,6 +226,8 @@ static apr_status_t add_request(h2_proxy
     apr_status_t status;
 
     url = apr_table_get(r->notes, H2_PROXY_REQ_URL_NOTE);
+    apr_table_setn(r->notes, "proxy-source-port", apr_psprintf(r->pool, "%hu",
+                   ctx->p_conn->connection->local_addr->port));
     status = h2_proxy_session_submit(session, url, r);
     if (status != OK) {
         ap_log_cerror(APLOG_MARK, APLOG_ERR, status, r->connection, APLOGNO(03351)



Re: svn commit: r1734238 - in /httpd/httpd/trunk: docs/manual/mod/mod_proxy_http2.xml modules/http2/h2_proxy_session.c modules/http2/mod_proxy_http2.c

Posted by Stefan Eissing <st...@greenbytes.de>.
Thanks, Eric. Fixed in r1742073.

-Stefan

> Am 02.05.2016 um 20:25 schrieb Eric Covener <co...@gmail.com>:
> 
> On Wed, Mar 9, 2016 at 8:41 AM,  <ic...@apache.org> wrote:
>> +    <p><module>mod_proxy_http2</module> works with incoming requests
>> +    over HTTP/1.1 and HTTP/2 requests. If <module>mod_proxy_http2</module>
>> +    handles the frontend connection, requests against the same HTTP/2
>> +    backend are sent over a single connection, whenever possible.</p>
> 
> 
> Should the second module be mod_http2 here?


Re: svn commit: r1734238 - in /httpd/httpd/trunk: docs/manual/mod/mod_proxy_http2.xml modules/http2/h2_proxy_session.c modules/http2/mod_proxy_http2.c

Posted by Eric Covener <co...@gmail.com>.
On Wed, Mar 9, 2016 at 8:41 AM,  <ic...@apache.org> wrote:
> +    <p><module>mod_proxy_http2</module> works with incoming requests
> +    over HTTP/1.1 and HTTP/2 requests. If <module>mod_proxy_http2</module>
> +    handles the frontend connection, requests against the same HTTP/2
> +    backend are sent over a single connection, whenever possible.</p>


Should the second module be mod_http2 here?