httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1747735 - in /httpd/httpd/trunk: CHANGES modules/http2/h2_proxy_session.c modules/http2/h2_proxy_session.h modules/http2/mod_proxy_http2.c
Date Fri, 10 Jun 2016 15:27:34 GMT
Author: icing
Date: Fri Jun 10 15:27:34 2016
New Revision: 1747735

URL: http://svn.apache.org/viewvc?rev=1747735&view=rev
Log:
mod_proxy_http2: fix flow control when frontend connection is HTTP/1.1, patch by Evgeny Kotkov

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/http2/h2_proxy_session.c
    httpd/httpd/trunk/modules/http2/h2_proxy_session.h
    httpd/httpd/trunk/modules/http2/mod_proxy_http2.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1747735&r1=1747734&r2=1747735&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Jun 10 15:27:34 2016
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_http2: properly care for HTTP2 flow control of the frontend
+     connection is HTTP/1.1. [Patch supplied by Evgeny Kotkov]
+     
   *) mod_dav: Add support for childtags to dav_error.
      [Jari Urpalainen <jari.urpalainen nokia.com>]
 

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=1747735&r1=1747734&r2=1747735&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.c Fri Jun 10 15:27:34 2016
@@ -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_se
                                   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_pro
 }
 
 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
     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_rea
 }
 
 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", 

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_session.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_session.h?rev=1747735&r1=1747734&r2=1747735&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.h Fri Jun 10 15:27:34 2016
@@ -89,7 +89,7 @@ h2_proxy_session *h2_proxy_session_setup
                                          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

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=1747735&r1=1747734&r2=1747735&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_proxy_http2.c (original)
+++ httpd/httpd/trunk/modules/http2/mod_proxy_http2.c Fri Jun 10 15:27:34 2016
@@ -258,7 +258,7 @@ static apr_status_t add_request(h2_proxy
     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)",



Mime
View raw message