Don't set select_padding_callback if padding_boundary is 0 or not set

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-11 16:48:27 +09:00
parent 3144bcbe20
commit 39fe7a5cfa
2 changed files with 6 additions and 2 deletions

View File

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

View File

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