Skip to content

Commit 89fbbc4

Browse files
addaleaxMylesBorins
authored andcommitted
http2: simplify timeout tracking
There’s no need to reset the chunk counter for every write. PR-URL: #19206 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 0602166 commit 89fbbc4

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
@@ -1630,10 +1630,6 @@ inline Http2Stream* Http2Session::SubmitRequest(
16301630
return stream;
16311631
}
16321632

1633-
inline void Http2Session::SetChunksSinceLastWrite(size_t n) {
1634-
chunks_sent_since_last_write_ = n;
1635-
}
1636-
16371633
// Callback used to receive inbound data from the i/o stream
16381634
void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
16391635
Http2Scope h2scope(this);
@@ -2016,7 +2012,6 @@ inline int Http2Stream::DoWrite(WriteWrap* req_wrap,
20162012
CHECK(!this->IsDestroyed());
20172013
CHECK_EQ(send_handle, nullptr);
20182014
Http2Scope h2scope(this);
2019-
session_->SetChunksSinceLastWrite();
20202015
if (!IsWritable()) {
20212016
req_wrap->Done(UV_EOF);
20222017
return 0;
@@ -2519,8 +2514,6 @@ void Http2Stream::RespondFD(const FunctionCallbackInfo<Value>& args) {
25192514
int64_t length = args[3]->IntegerValue(context).ToChecked();
25202515
int options = args[4]->IntegerValue(context).ToChecked();
25212516

2522-
stream->session()->SetChunksSinceLastWrite();
2523-
25242517
Headers list(isolate, context, headers);
25252518
args.GetReturnValue().Set(stream->SubmitFile(fd, *list, list.length(),
25262519
offset, length, options));

src/node_http2.h

-2
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,6 @@ class Http2Session : public AsyncWrap, public StreamListener {
884884
// Write data to the session
885885
inline ssize_t Write(const uv_buf_t* bufs, size_t nbufs);
886886

887-
inline void SetChunksSinceLastWrite(size_t n = 0);
888-
889887
size_t self_size() const override { return sizeof(*this); }
890888

891889
inline void GetTrailers(Http2Stream* stream, uint32_t* flags);

0 commit comments

Comments
 (0)