From 90914b38f116d5bcaac2034af0a6e084ac47681d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 7 Jan 2015 01:25:43 +0900 Subject: [PATCH] nghttpx: Do not limit DATA frame length --- src/shrpx_http2_upstream.cc | 11 ----------- src/shrpx_spdy_upstream.cc | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 49ad33fa..81dac177 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -961,19 +961,8 @@ ssize_t downstream_data_read_callback(nghttp2_session *session, auto downstream = static_cast(source->ptr); auto upstream = static_cast(downstream->get_upstream()); auto body = downstream->get_response_buf(); - auto handler = upstream->get_client_handler(); assert(body); - auto limit = handler->get_write_limit(); - - if (limit != -1) { - // 9 is HTTP/2 frame header length. Make DATA frame also under - // certain limit, so that application layer can flush at DATA - // frame boundary, instead of buffering large frame. - assert(limit > 9); - length = std::min(length, static_cast(limit - 9)); - } - auto nread = body->remove(buf, length); auto body_empty = body->rleft() == 0; diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 51a6532f..af206e05 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -680,19 +680,8 @@ ssize_t spdy_data_read_callback(spdylay_session *session, int32_t stream_id, auto downstream = static_cast(source->ptr); auto upstream = static_cast(downstream->get_upstream()); auto body = downstream->get_response_buf(); - auto handler = upstream->get_client_handler(); assert(body); - auto limit = handler->get_write_limit(); - - if (limit != -1) { - // 9 is HTTP/2 frame header length. Make DATA frame also under - // certain limit, so that application layer can flush at DATA - // frame boundary, instead of buffering large frame. - assert(limit > 9); - length = std::min(length, static_cast(limit - 9)); - } - auto nread = body->remove(buf, length); auto body_empty = body->rleft() == 0;