]> granicus.if.org Git - apache/commitdiff
Merge of r1747735 from trunk:
authorStefan Eissing <icing@apache.org>
Mon, 13 Jun 2016 09:58:07 +0000 (09:58 +0000)
committerStefan Eissing <icing@apache.org>
Mon, 13 Jun 2016 09:58:07 +0000 (09:58 +0000)
mod_proxy_http2: properly care for HTTP2 flow control of the frontend
     connection is HTTP/1.1. [Patch supplied by Evgeny Kotkov]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1748168 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http2/h2_proxy_session.c
modules/http2/h2_proxy_session.h
modules/http2/h2_version.h
modules/http2/mod_proxy_http2.c

diff --git a/CHANGES b/CHANGES
index ec9512bbd6294a3a7ba21ded0ce6cf947ad21b75..e8a4ba66ebfc5b4696fee82847a5abade343b447 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.21
 
+  *) mod_proxy_http2: properly care for HTTP2 flow control of the frontend
+     connection is HTTP/1.1. [Patch supplied by Evgeny Kotkov]
+     
   *) mod_http2: improved cleanup of connection/streams/tasks to always
      have deterministic order regardless of event initiating it. Addresses
      reported crashes due to memory read after free issues. 
index 34b584909d04e97d12ee0ffcde660d1a376fc9cb..919fe4a4c36a6ab6fbed46b25bc523e85dbcf621 100644 (file)
@@ -36,6 +36,7 @@ typedef struct h2_proxy_stream {
     const char *url;
     request_rec *r;
     h2_request *req;
+    int standalone;
 
     h2_stream_state_t state;
     unsigned int suspended : 1;
@@ -370,6 +371,12 @@ static int on_data_chunk_recv(nghttp2_session *ngh2, uint8_t flags,
                                   stream_id, NGHTTP2_STREAM_CLOSED);
         return NGHTTP2_ERR_STREAM_CLOSING;
     }
+    if (stream->standalone) {
+        nghttp2_session_consume(ngh2, stream_id, len);
+        ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, stream->r,
+                      "h2_proxy_session(%s): stream %d, win_update %d bytes",
+                      session->id, stream_id, (int)len);
+    }
     return 0;
 }
 
@@ -576,7 +583,8 @@ static apr_status_t session_start(h2_proxy_session *session)
 }
 
 static apr_status_t open_stream(h2_proxy_session *session, const char *url,
-                                request_rec *r, h2_proxy_stream **pstream)
+                                request_rec *r, int standalone,
+                                h2_proxy_stream **pstream)
 {
     h2_proxy_stream *stream;
     apr_uri_t puri;
@@ -588,6 +596,7 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
     stream->pool = r->pool;
     stream->url = url;
     stream->r = r;
+    stream->standalone = standalone;
     stream->session = session;
     stream->state = H2_STREAM_ST_IDLE;
     
@@ -761,12 +770,13 @@ static apr_status_t h2_proxy_session_read(h2_proxy_session *session, int block,
 }
 
 apr_status_t h2_proxy_session_submit(h2_proxy_session *session, 
-                                     const char *url, request_rec *r)
+                                     const char *url, request_rec *r,
+                                     int standalone)
 {
     h2_proxy_stream *stream;
     apr_status_t status;
     
-    status = open_stream(session, url, r, &stream);
+    status = open_stream(session, url, r, standalone, &stream);
     if (status == APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03381)
                       "process stream(%d): %s %s%s, original: %s", 
index 52be5c6b37b6207085921e0b509ddb81cc25f718..7f0a194097f720fbe0ea5dffe8443bb7ce597325 100644 (file)
@@ -89,7 +89,7 @@ h2_proxy_session *h2_proxy_session_setup(const char *id, proxy_conn_rec *p_conn,
                                          h2_proxy_request_done *done);
 
 apr_status_t h2_proxy_session_submit(h2_proxy_session *s, const char *url,
-                                     request_rec *r);
+                                     request_rec *r, int standalone);
                        
 /** 
  * Perform a step in processing the proxy session. Will return aftert
index 8fac3beb1f9faea520e12b95a8eaf4e66bfb6bf9..2b9ef754e6ee13a104ec3eac961fc75c90fbc8ff 100644 (file)
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.5.8"
+#define MOD_HTTP2_VERSION "1.5.9"
 
 /**
  * @macro
@@ -34,7 +34,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MOD_HTTP2_VERSION_NUM 0x010508
+#define MOD_HTTP2_VERSION_NUM 0x010509
 
 
 #endif /* mod_h2_h2_version_h */
index d551f24e818f400999b23b02812a83955c17494b..7dfee7083af435b356d86eaa08b3881bc8a87084 100644 (file)
@@ -258,7 +258,7 @@ static apr_status_t add_request(h2_proxy_session *session, request_rec *r)
     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);
+    status = h2_proxy_session_submit(session, url, r, ctx->standalone);
     if (status != APR_SUCCESS) {
         ap_log_cerror(APLOG_MARK, APLOG_ERR, status, r->connection, APLOGNO(03351)
                       "pass request body failed to %pI (%s) from %s (%s)",