From 39fe7a5cfa54a51682d30a1974a4c539c4c941e3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 11 Feb 2014 16:48:27 +0900 Subject: [PATCH] Don't set select_padding_callback if padding_boundary is 0 or not set --- src/HttpServer.cc | 4 +++- src/nghttp.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 196a0999..6a364dca 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -988,7 +988,9 @@ void fill_callback(nghttp2_session_callbacks& callbacks, const Config *config) callbacks.on_data_chunk_recv_callback = on_data_chunk_recv_callback; callbacks.on_header_callback = on_header_callback; callbacks.on_begin_headers_callback = on_begin_headers_callback; - callbacks.select_padding_callback = select_padding_callback; + if(config->padding_boundary) { + callbacks.select_padding_callback = select_padding_callback; + } } } // namespace diff --git a/src/nghttp.cc b/src/nghttp.cc index 69d35d5b..25bec8cf 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -1598,7 +1598,9 @@ int run(char **uris, int n) } callbacks.on_data_chunk_recv_callback = on_data_chunk_recv_callback; callbacks.on_header_callback = on_header_callback; - callbacks.select_padding_callback = select_padding_callback; + if(config.padding_boundary) { + callbacks.select_padding_callback = select_padding_callback; + } std::string prev_scheme; std::string prev_host;