From 0ced4741d2283d9d44e781f49aab47b56b692e31 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 29 Oct 2013 22:00:31 +0900 Subject: [PATCH] nghttpx: Remove flow control error detection code Now flow control error detection is handled by the library --- src/shrpx_http2_upstream.cc | 16 ---------------- src/shrpx_spdy_session.cc | 14 -------------- 2 files changed, 30 deletions(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 1ddecfd6..8802b213 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -309,22 +309,6 @@ int 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() > - 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() - << ", initial_window_size=" - << upstream->get_initial_window_size(); - } - upstream->rst_stream(downstream, NGHTTP2_FLOW_CONTROL_ERROR); - return 0; - } } if(flags & NGHTTP2_FLAG_END_STREAM) { downstream->set_request_state(Downstream::MSG_COMPLETE); diff --git a/src/shrpx_spdy_session.cc b/src/shrpx_spdy_session.cc index 40848a1f..a71a740a 100644 --- a/src/shrpx_spdy_session.cc +++ b/src/shrpx_spdy_session.cc @@ -925,20 +925,6 @@ int 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() > - 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() - << ", initial_window_size=" - << spdy->get_initial_window_size(); - } - spdy->submit_rst_stream(stream_id, NGHTTP2_FLOW_CONTROL_ERROR); - downstream->set_response_state(Downstream::MSG_RESET); - call_downstream_readcb(spdy, downstream); - return 0; - } } auto upstream = downstream->get_upstream();