Support one header field size (name + value) up to 64KiB by default

This commits changes the upper bound of one header field size (the sum
of the length of name and value) to 64KiB by default.  We may add an
option to change this upper bound in the future.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-28 11:04:41 +09:00
parent ff3a4a770f
commit d318e6a62e
3 changed files with 3 additions and 3 deletions

View File

@ -366,7 +366,7 @@ int nghttp2_hd_inflate_init(nghttp2_hd_inflater *inflater)
inflater->opcode = NGHTTP2_HD_OPCODE_NONE;
inflater->state = NGHTTP2_HD_STATE_OPCODE;
rv = nghttp2_bufs_init(&inflater->nvbufs, NGHTTP2_HD_MAX_NV / 2, 2);
rv = nghttp2_bufs_init3(&inflater->nvbufs, NGHTTP2_HD_MAX_NV / 8, 8, 1, 0);
if(rv != 0) {
goto nvbufs_fail;

View File

@ -40,7 +40,7 @@
/* The maximum length of one name/value pair. This is the sum of the
length of name and value. This is not specified by the spec. We
just chose the arbitrary size */
#define NGHTTP2_HD_MAX_NV 8192
#define NGHTTP2_HD_MAX_NV 65536
/* Default size of maximum table buffer size for encoder. Even if
remote decoder notifies larger buffer size for its decoding,

View File

@ -342,7 +342,7 @@ static int session_new(nghttp2_session **session_ptr,
/* 1 for Pad Field. */
rv = nghttp2_bufs_init3(&(*session_ptr)->aob.framebufs,
NGHTTP2_FRAMEBUF_CHUNKLEN, 8, 1,
NGHTTP2_FRAMEBUF_CHUNKLEN, 4, 1,
NGHTTP2_FRAME_HDLEN + 1);
if(rv != 0) {
goto fail_aob_framebuf;