Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlba Mendez <me@alba.sh>2020-04-27 04:15:07 +0300
committerAnna Henningsen <anna@addaleax.net>2020-04-28 20:20:19 +0300
commitee9280a02a4f8810a2d4fd409d08266ce95f2184 (patch)
tree7e91d971e6477b49f83c9820a7f60ff44d25c7cd /src/node_http2.cc
parent8e956f450ad0ebd2b06235620eaaa00ead3af375 (diff)
http2,doc: minor fixes
Some small fixes on HTTP/2 and its documentation: - Add a note that, on server streams, it's not necessary to start data flow. - Set EOF flag if we have marked all data for sending: there's no need to wait until the queue is actually empty (and send a separate, empty DATA). (Note that, even with this change, a separate DATA frame will always be sent, because the streams layer waits until data has been flushed before dispatching EOF) PR-URL: https://github.com/nodejs/node/pull/28044 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_http2.cc')
-rw-r--r--src/node_http2.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_http2.cc b/src/node_http2.cc
index 189f1d50a29..6637166e954 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -2309,7 +2309,7 @@ ssize_t Http2Stream::Provider::Stream::OnRead(nghttp2_session* handle,
return NGHTTP2_ERR_DEFERRED;
}
- if (stream->queue_.empty() && !stream->is_writable()) {
+ if (stream->available_outbound_length_ == 0 && !stream->is_writable()) {
Debug(session, "no more data for stream %d", id);
*flags |= NGHTTP2_DATA_FLAG_EOF;
if (stream->has_trailers()) {