#include "h2_ctx.h"
#include "h2_conn.h"
#include "h2_config.h"
+#include "h2_h2.h"
#include "h2_private.h"
#define DEF_VAL (-1)
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;
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 */
}
}
- 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,