Allow disabling padding

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-09 23:53:53 +09:00
parent 5b58b4ace5
commit 118ed09da5
4 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -1711,7 +1711,8 @@ void print_help(std::ostream& out)
<< " -c, --header-table-size=<N>\n"
<< " Specify decoder header table size.\n"
<< " -b, --padding=<BOUNDARY>\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;

View File

@ -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=<BOUNDARY>\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;
}