Skip to content

Commit 7f34c27

Browse files
addaleaxMylesBorins
authored andcommitted
http2: simplify timeout tracking
There’s no need to reset the chunk counter for every write. Backport-PR-URL: #23774 PR-URL: #19206 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 18071db commit 7f34c27

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/node_http2.cc

-7
Original file line numberDiff line numberDiff line change
@@ -1798,10 +1798,6 @@ inline Http2Stream* Http2Session::SubmitRequest(
17981798
return stream;
17991799
}
18001800

1801-
inline void Http2Session::SetChunksSinceLastWrite(size_t n) {
1802-
chunks_sent_since_last_write_ = n;
1803-
}
1804-
18051801
// Allocates the data buffer used to pass outbound data to the i/o stream.
18061802
WriteWrap* Http2Session::AllocateSend() {
18071803
HandleScope scope(env()->isolate());
@@ -2257,7 +2253,6 @@ inline int Http2Stream::DoWrite(WriteWrap* req_wrap,
22572253
CHECK(!this->IsDestroyed());
22582254
CHECK_EQ(send_handle, nullptr);
22592255
Http2Scope h2scope(this);
2260-
session_->SetChunksSinceLastWrite();
22612256
req_wrap->Dispatched();
22622257
if (!IsWritable()) {
22632258
req_wrap->Done(UV_EOF);
@@ -2751,8 +2746,6 @@ void Http2Stream::RespondFD(const FunctionCallbackInfo<Value>& args) {
27512746
int64_t length = args[3]->IntegerValue(context).ToChecked();
27522747
int options = args[4]->IntegerValue(context).ToChecked();
27532748

2754-
stream->session()->SetChunksSinceLastWrite();
2755-
27562749
Headers list(isolate, context, headers);
27572750
args.GetReturnValue().Set(stream->SubmitFile(fd, *list, list.length(),
27582751
offset, length, options));

src/node_http2.h

-2
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,6 @@ class Http2Session : public AsyncWrap {
815815
// Write data to the session
816816
inline ssize_t Write(const uv_buf_t* bufs, size_t nbufs);
817817

818-
inline void SetChunksSinceLastWrite(size_t n = 0);
819-
820818
size_t self_size() const override { return sizeof(*this); }
821819

822820
char* stream_alloc() {

0 commit comments

Comments
 (0)