Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: send out pending data earlier #29398

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,10 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle,
stream->inbound_consumed_data_while_paused_ += avail;

// If we have a gathered a lot of data for output, try sending it now.
if (session->outgoing_length_ > 4096) session->SendPendingData();
if (session->outgoing_length_ > 4096 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not a c++ expert, but we can move 4096 to variable and re-use.

stream->available_outbound_length_ > 4096) {
session->SendPendingData();
}
} while (len != 0);

// If we are currently waiting for a write operation to finish, we should
Expand Down