Skip to content

Commit

Permalink
http2: simplify timeout tracking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and MylesBorins committed Mar 20, 2018
1 parent 0602166 commit 89fbbc4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1630,10 +1630,6 @@ inline Http2Stream* Http2Session::SubmitRequest(
return stream;
}

inline void Http2Session::SetChunksSinceLastWrite(size_t n) {
chunks_sent_since_last_write_ = n;
}

// Callback used to receive inbound data from the i/o stream
void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
Http2Scope h2scope(this);
Expand Down Expand Up @@ -2016,7 +2012,6 @@ inline int Http2Stream::DoWrite(WriteWrap* req_wrap,
CHECK(!this->IsDestroyed());
CHECK_EQ(send_handle, nullptr);
Http2Scope h2scope(this);
session_->SetChunksSinceLastWrite();
if (!IsWritable()) {
req_wrap->Done(UV_EOF);
return 0;
Expand Down Expand Up @@ -2519,8 +2514,6 @@ void Http2Stream::RespondFD(const FunctionCallbackInfo<Value>& 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));
Expand Down
2 changes: 0 additions & 2 deletions src/node_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,6 @@ class Http2Session : public AsyncWrap, public StreamListener {
// 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); }

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

0 comments on commit 89fbbc4

Please sign in to comment.