nghttpx: Accept incoming bytes at least initial window size

This commit is contained in:
Tatsuhiro Tsujikawa 2013-08-07 21:27:08 +09:00
parent 7f71e83c52
commit fafec1fdb8
3 changed files with 10 additions and 3 deletions

View File

@ -284,8 +284,13 @@ void on_data_chunk_recv_callback(nghttp2_session *session,
}
if(upstream->get_flow_control()) {
downstream->inc_recv_window_size(len);
// In case that user specified initial window size is smaller
// than default one and avoid stream tear down for the first
// request due to race condition, we allow at least default
// initial window size.
if(downstream->get_recv_window_size() >
upstream->get_initial_window_size()) {
std::max(NGHTTP2_INITIAL_WINDOW_SIZE,
upstream->get_initial_window_size())) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, upstream) << "Flow control error: recv_window_size="
<< downstream->get_recv_window_size()

View File

@ -906,7 +906,9 @@ void on_data_chunk_recv_callback(nghttp2_session *session,
if(spdy->get_flow_control()) {
sd->dconn->inc_recv_window_size(len);
if(sd->dconn->get_recv_window_size() > spdy->get_initial_window_size()) {
if(sd->dconn->get_recv_window_size() >
std::max(NGHTTP2_INITIAL_WINDOW_SIZE,
spdy->get_initial_window_size())) {
if(LOG_ENABLED(INFO)) {
SSLOG(INFO, spdy) << "Flow control error: recv_window_size="
<< sd->dconn->get_recv_window_size()

View File

@ -248,7 +248,7 @@ void on_data_chunk_recv_callback(spdylay_session *session,
if(upstream->get_flow_control()) {
downstream->inc_recv_window_size(len);
if(downstream->get_recv_window_size() >
upstream->get_initial_window_size()) {
std::max(65536, upstream->get_initial_window_size())) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, upstream) << "Flow control error: recv_window_size="
<< downstream->get_recv_window_size()