Skip to content

Commit

Permalink
nghttpx: Do not limit DATA frame length
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Jan 6, 2015
1 parent 8bfd900 commit 90914b3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions src/shrpx_http2_upstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -961,19 +961,8 @@ ssize_t downstream_data_read_callback(nghttp2_session *session,
auto downstream = static_cast<Downstream *>(source->ptr);
auto upstream = static_cast<Http2Upstream *>(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<size_t>(limit - 9));
}

auto nread = body->remove(buf, length);
auto body_empty = body->rleft() == 0;

Expand Down
11 changes: 0 additions & 11 deletions src/shrpx_spdy_upstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,19 +680,8 @@ ssize_t spdy_data_read_callback(spdylay_session *session, int32_t stream_id,
auto downstream = static_cast<Downstream *>(source->ptr);
auto upstream = static_cast<SpdyUpstream *>(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<size_t>(limit - 9));
}

auto nread = body->remove(buf, length);
auto body_empty = body->rleft() == 0;

Expand Down

0 comments on commit 90914b3

Please sign in to comment.