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 2015/11/16 12:42:14 UTC
svn commit: r1714560 - in /httpd/httpd/trunk/modules/http2: h2_config.c
h2_h2.h h2_session.c
Author: icing
Date: Mon Nov 16 11:42:14 2015
New Revision: 1714560
URL: http://svn.apache.org/viewvc?rev=1714560&view=rev
Log:
chaning WINDOW_SIZE default to protocol default, avoid sending the default value as SETTINGS
Modified:
httpd/httpd/trunk/modules/http2/h2_config.c
httpd/httpd/trunk/modules/http2/h2_h2.h
httpd/httpd/trunk/modules/http2/h2_session.c
Modified: httpd/httpd/trunk/modules/http2/h2_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_config.c?rev=1714560&r1=1714559&r2=1714560&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_config.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_config.c Mon Nov 16 11:42:14 2015
@@ -29,6 +29,7 @@
#include "h2_ctx.h"
#include "h2_conn.h"
#include "h2_config.h"
+#include "h2_h2.h"
#include "h2_private.h"
#define DEF_VAL (-1)
@@ -38,22 +39,22 @@
static h2_config defconf = {
"default",
- 100, /* max_streams */
- 64 * 1024, /* window_size */
- -1, /* min workers */
- -1, /* max workers */
- 10 * 60, /* max workers idle secs */
- 64 * 1024, /* stream max mem size */
- NULL, /* no alt-svcs */
- -1, /* alt-svc max age */
- 0, /* serialize headers */
- -1, /* h2 direct mode */
- -1, /* # session extra files */
- 1, /* modern TLS only */
- -1, /* HTTP/1 Upgrade support */
- 1024*1024, /* TLS warmup size */
- 1, /* TLS cooldown secs */
- 1, /* HTTP/2 server push enabled */
+ 100, /* max_streams */
+ H2_INITIAL_WINDOW_SIZE, /* window_size */
+ -1, /* min workers */
+ -1, /* max workers */
+ 10 * 60, /* max workers idle secs */
+ 64 * 1024, /* stream max mem size */
+ NULL, /* no alt-svcs */
+ -1, /* alt-svc max age */
+ 0, /* serialize headers */
+ -1, /* h2 direct mode */
+ -1, /* # session extra files */
+ 1, /* modern TLS only */
+ -1, /* HTTP/1 Upgrade support */
+ 1024*1024, /* TLS warmup size */
+ 1, /* TLS cooldown secs */
+ 1, /* HTTP/2 server push enabled */
};
static int files_per_session = 0;
Modified: httpd/httpd/trunk/modules/http2/h2_h2.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_h2.h?rev=1714560&r1=1714559&r2=1714560&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_h2.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_h2.h Mon Nov 16 11:42:14 2015
@@ -51,6 +51,8 @@ extern const char *H2_MAGIC_TOKEN;
/* Maximum number of padding bytes in a frame, rfc7540 */
#define H2_MAX_PADLEN 256
+/* Initial default window size, RFC 7540 ch. 6.5.2 */
+#define H2_INITIAL_WINDOW_SIZE ((64*1024)-1)
#define H2_HTTP_2XX(a) ((a) >= 200 && (a) < 300)
Modified: httpd/httpd/trunk/modules/http2/h2_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_session.c?rev=1714560&r1=1714559&r2=1714560&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_session.c Mon Nov 16 11:42:14 2015
@@ -828,6 +828,8 @@ apr_status_t h2_session_start(h2_session
apr_status_t status = APR_SUCCESS;
h2_config *config;
nghttp2_settings_entry settings[3];
+ size_t slen;
+ int i;
AP_DEBUG_ASSERT(session);
/* Start the conversation by submitting our SETTINGS frame */
@@ -890,16 +892,19 @@ apr_status_t h2_session_start(h2_session
}
}
- settings[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
- settings[0].value = (uint32_t)session->max_stream_count;
- settings[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
- settings[1].value = h2_config_geti(config, H2_CONF_WIN_SIZE);
- settings[2].settings_id = NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE;
- settings[2].value = 64*1024;
+ slen = 0;
+ settings[slen].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
+ settings[slen].value = (uint32_t)session->max_stream_count;
+ ++slen;
+ i = h2_config_geti(config, H2_CONF_WIN_SIZE);
+ if (i != H2_INITIAL_WINDOW_SIZE) {
+ settings[slen].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
+ settings[slen].value = i;
+ ++slen;
+ }
*rv = nghttp2_submit_settings(session->ngh2, NGHTTP2_FLAG_NONE,
- settings,
- sizeof(settings)/sizeof(settings[0]));
+ settings, slen);
if (*rv != 0) {
status = APR_EGENERAL;
ap_log_cerror(APLOG_MARK, APLOG_ERR, status, session->c,