From c58f8e546df670845c1a5ae5a47a8aaaddddc947 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 26 Oct 2013 01:08:32 +0900 Subject: [PATCH 1/4] nghttp2_hd: Fix hd_table_bufsize gets wrong when inserting large header --- lib/nghttp2_hd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index eb36a163..97732de8 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -587,9 +587,8 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context, size_t i; nghttp2_hd_entry *new_ent; size_t room = entry_room(nv->namelen, nv->valuelen); - context->hd_table_bufsize += room; for(i = 0; i < context->hd_tablelen && - context->hd_table_bufsize > NGHTTP2_HD_MAX_BUFFER_SIZE; ++i) { + context->hd_table_bufsize + room > NGHTTP2_HD_MAX_BUFFER_SIZE; ++i) { nghttp2_hd_entry *ent = context->hd_table[i]; context->hd_table_bufsize -= entry_room(ent->nv.namelen, ent->nv.valuelen); if(context->role == NGHTTP2_HD_ROLE_DEFLATE && @@ -639,6 +638,7 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context, context->hd_tablelen is strictly less than context->hd_table_capacity. */ assert(context->hd_tablelen < context->hd_table_capacity); + context->hd_table_bufsize += room; context->hd_table[context->hd_tablelen++] = new_ent; new_ent->flags |= NGHTTP2_HD_FLAG_REFSET; } @@ -663,10 +663,10 @@ static nghttp2_hd_entry* add_hd_table_subst(nghttp2_hd_context *context, context->hd_table_bufsize -= entry_room(context->hd_table[subindex]->nv.namelen, context->hd_table[subindex]->nv.valuelen); - context->hd_table_bufsize += room; k = subindex; for(i = 0; i < context->hd_tablelen && - context->hd_table_bufsize > NGHTTP2_HD_MAX_BUFFER_SIZE; ++i, --k) { + context->hd_table_bufsize + room > NGHTTP2_HD_MAX_BUFFER_SIZE; + ++i, --k) { nghttp2_hd_entry *ent = context->hd_table[i]; if(i != subindex) { context->hd_table_bufsize -= entry_room(ent->nv.namelen, @@ -721,6 +721,7 @@ static nghttp2_hd_entry* add_hd_table_subst(nghttp2_hd_context *context, --new_ent->ref; context->hd_tablelen = 0; } else { + context->hd_table_bufsize += room; context->hd_table[new_ent->index] = new_ent; new_ent->flags |= NGHTTP2_HD_FLAG_REFSET; } From a41689145453eb90368a00e0f158a0280551aa31 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 28 Oct 2013 21:48:59 +0900 Subject: [PATCH 2/4] tests: Fix test error on 32-bit system --- tests/nghttp2_session_test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index be69a935..6435175d 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -3499,7 +3499,8 @@ void test_nghttp2_session_set_option(void) NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS, &sszval, sizeof(sszval))); CU_ASSERT(sszval == - session->remote_settings[NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS]); + (ssize_t)session-> + remote_settings[NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS]); sszval = 0; CU_ASSERT(NGHTTP2_ERR_INVALID_ARGUMENT == @@ -3508,12 +3509,12 @@ void test_nghttp2_session_set_option(void) NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS, &sszval, sizeof(sszval))); - intval = 100; + charval = 100; CU_ASSERT(NGHTTP2_ERR_INVALID_ARGUMENT == nghttp2_session_set_option (session, NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS, - &intval, sizeof(intval))); + &charval, sizeof(charval))); nghttp2_session_del(session); } From 2b8b368fa89a6dea4b2f1c0faca315ecbccd3a80 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 28 Oct 2013 22:47:12 +0900 Subject: [PATCH 3/4] Fix `make distcheck` --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f164b798..75b95982 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,4 +26,4 @@ ACLOCAL_AMFLAGS = -I m4 dist_doc_DATA = README.rst -EXTRA_DIST = shrpx.conf.sample proxy.pac.sample android-config android-make +EXTRA_DIST = nghttpx.conf.sample proxy.pac.sample android-config android-make From 5d5a64166634c01d055b3189043c4e2c639ea92a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 28 Oct 2013 22:53:32 +0900 Subject: [PATCH 4/4] Bump up version number to 0.1.0 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 17f826fa..523e9417 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AC_PREREQ(2.61) -AC_INIT([nghttp2], [0.1.0-DEV], [t-tujikawa@users.sourceforge.net]) +AC_INIT([nghttp2], [0.1.0], [t-tujikawa@users.sourceforge.net]) LT_PREREQ([2.2.6]) LT_INIT() dnl See versioning rule: