From 8f007268e6d73dd0ceeb4c596e6095b510440d82 Mon Sep 17 00:00:00 2001 From: Wenfeng Liu Date: Wed, 3 Aug 2016 07:57:37 +0000 Subject: [PATCH] Make get_max_index() return the max index in frame, so we don't need to do extra calculation --- lib/nghttp2_hd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 lib/nghttp2_hd.c diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c old mode 100644 new mode 100755 index 59f7f379..a02ef83a --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1311,7 +1311,7 @@ int nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater, ((idx) < (context)->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH) static size_t get_max_index(nghttp2_hd_context *context) { - return context->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH - 1; + return context->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH; } nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t idx) { @@ -1955,7 +1955,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater, rfin = 0; rv = hd_inflate_read_len(inflater, &rfin, in, last, prefixlen, - get_max_index(&inflater->ctx) + 1); + get_max_index(&inflater->ctx)); if (rv < 0) { goto fail; }