From 118ed09da5d322f37d6d3b31fe1139c9ed60a2f4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 9 Feb 2014 23:53:53 +0900 Subject: [PATCH] Allow disabling padding --- lib/includes/nghttp2/nghttp2.h | 3 +-- lib/nghttp2_session.c | 3 +-- src/nghttp.cc | 3 ++- src/nghttpd.cc | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 6983b1d4..b24217ad 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -1338,8 +1338,7 @@ typedef enum { * payload. If this option is set to N, padding is added to frame * payload so that its payload length is divisible by N. For DATA * frame, due to flow control, padding is not always added according - * to this alignment. The option value must be greater than or equal - * to 8. + * to this alignment. Specifying 0 to this option disables padding. */ NGHTTP2_OPT_PADDING_BOUNDARY = 1 << 3 } nghttp2_opt; diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 0bfa2ede..609297d6 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -224,8 +224,7 @@ static int nghttp2_session_new(nghttp2_session **session_ptr, (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_AUTO_CONNECTION_WINDOW_UPDATE; } - if((opt_set_mask & NGHTTP2_OPT_PADDING_BOUNDARY) && - opt_set->padding_boundary >= 8) { + if(opt_set_mask & NGHTTP2_OPT_PADDING_BOUNDARY) { (*session_ptr)->padding_boundary = opt_set->padding_boundary; } else { (*session_ptr)->padding_boundary = NGHTTP2_PADDING_BOUNDARY; diff --git a/src/nghttp.cc b/src/nghttp.cc index 197b4c26..dcd9d8ae 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -1711,7 +1711,8 @@ void print_help(std::ostream& out) << " -c, --header-table-size=\n" << " Specify decoder header table size.\n" << " -b, --padding=\n" - << " Padding boundary for frame payload.\n" + << " Padding boundary for frame payload. Specify\n" + << " 0 to disable padding.\n" << " --color Force colored log output.\n" << " --continuation Send large header to test CONTINUATION.\n" << std::endl; diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 2287171d..30bbeb0e 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -116,7 +116,8 @@ void print_help(std::ostream& out) << " PATH and PUSH_PATHs are relative to document\n" << " root. See --htdocs option.\n" << " -b, --padding=\n" - << " Padding boundary for frame payload.\n" + << " Padding boundary for frame payload. Specify\n" + << " 0 to disable padding.\n" << " -h, --help Print this help.\n" << std::endl; }