asio: Use large window size for client

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-07 00:26:19 +09:00
parent f8182333b4
commit 36a9cbf41f
1 changed files with 11 additions and 2 deletions

View File

@ -315,9 +315,18 @@ bool session_impl::setup_session() {
return false;
}
nghttp2_settings_entry iv = {NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100};
nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, &iv, 1);
const uint32_t window_size = 256 * 1024 * 1024;
std::array<nghttp2_settings_entry, 2> iv{
{{NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100},
// typically client is just a *sink* and just process data as
// much as possible. Use large window size by default.
{NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, window_size}}};
nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, iv.data(), iv.size());
// increase connection window size up to window_size
nghttp2_submit_window_update(session_, NGHTTP2_FLAG_NONE, 0,
window_size -
NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE);
return true;
}