From 7f34c277accdfffe0b87b24f5e2fda889b1ac924 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 22 Feb 2018 13:48:06 +0100 Subject: [PATCH] http2: simplify timeout tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s no need to reset the chunk counter for every write. Backport-PR-URL: https://github.com/nodejs/node/pull/23774 PR-URL: https://github.com/nodejs/node/pull/19206 Reviewed-By: James M Snell Reviewed-By: Daniel Bevenius Reviewed-By: Anatoli Papirovski Reviewed-By: Colin Ihrig --- src/node_http2.cc | 7 ------- src/node_http2.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index 49238dcae2d966..f56489bc5a034e 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1798,10 +1798,6 @@ inline Http2Stream* Http2Session::SubmitRequest( return stream; } -inline void Http2Session::SetChunksSinceLastWrite(size_t n) { - chunks_sent_since_last_write_ = n; -} - // Allocates the data buffer used to pass outbound data to the i/o stream. WriteWrap* Http2Session::AllocateSend() { HandleScope scope(env()->isolate()); @@ -2257,7 +2253,6 @@ inline int Http2Stream::DoWrite(WriteWrap* req_wrap, CHECK(!this->IsDestroyed()); CHECK_EQ(send_handle, nullptr); Http2Scope h2scope(this); - session_->SetChunksSinceLastWrite(); req_wrap->Dispatched(); if (!IsWritable()) { req_wrap->Done(UV_EOF); @@ -2751,8 +2746,6 @@ void Http2Stream::RespondFD(const FunctionCallbackInfo& args) { int64_t length = args[3]->IntegerValue(context).ToChecked(); int options = args[4]->IntegerValue(context).ToChecked(); - stream->session()->SetChunksSinceLastWrite(); - Headers list(isolate, context, headers); args.GetReturnValue().Set(stream->SubmitFile(fd, *list, list.length(), offset, length, options)); diff --git a/src/node_http2.h b/src/node_http2.h index ca0dd55f97f674..a4e37562f3f313 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -815,8 +815,6 @@ class Http2Session : public AsyncWrap { // Write data to the session inline ssize_t Write(const uv_buf_t* bufs, size_t nbufs); - inline void SetChunksSinceLastWrite(size_t n = 0); - size_t self_size() const override { return sizeof(*this); } char* stream_alloc() {