From d318e6a62ed4faaf94a19f1f78a77a23468e8c57 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 Jun 2014 11:04:41 +0900 Subject: [PATCH] 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. --- lib/nghttp2_hd.c | 2 +- lib/nghttp2_hd.h | 2 +- lib/nghttp2_session.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index c8a8af6f..4b6dbdff 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -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; diff --git a/lib/nghttp2_hd.h b/lib/nghttp2_hd.h index 542e1894..1781c597 100644 --- a/lib/nghttp2_hd.h +++ b/lib/nghttp2_hd.h @@ -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, diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 5e3a3924..c1a48752 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -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;