diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 638c6458..e585ce14 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1136,8 +1136,9 @@ size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, size_t i; /* Possible Maximum Header Table Size Change. Encoding (1u << 31) - - 1 using 4 bit prefix requires 6 bytes. */ - n += 6; + 1 using 4 bit prefix requires 6 bytes. We may emit this at most + twice. */ + n += 12; /* Use Literal Header Field without indexing - New Name, since it is most space consuming format. Also we choose the less one between diff --git a/tests/nghttp2_hd_test.c b/tests/nghttp2_hd_test.c index 485762d7..c27783fd 100644 --- a/tests/nghttp2_hd_test.c +++ b/tests/nghttp2_hd_test.c @@ -1081,7 +1081,7 @@ void test_nghttp2_hd_deflate_bound(void) bound = nghttp2_hd_deflate_bound(&deflater, nva, ARRLEN(nva)); - CU_ASSERT(6 + 6 * 2 * 2 + + CU_ASSERT(12 + 6 * 2 * 2 + nva[0].namelen + nva[0].valuelen + nva[1].namelen + nva[1].valuelen == bound);