New issue
Advanced search Search tips

Issue 591371 link

Starred by 3 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

QuicHttpStream::ReadAvailableData should only do OnFinRead() when IsDoneReading()

Project Member Reported by xunji...@chromium.org, Mar 2 2016

Issue description

During a CL review (crrev.com/1723373002/), it was discussed that when stream_->IsDoneReading() is true, we might only need to call OnFinRead().

Specifically, the stream_->SetDelegate(nullptr) and ResetStream() should be removed. The reason is that stream_->OnFinRead() will call QuicHttpStream::OnClose() if both read and write sides are closed. If we null out the delegate before calling OnFinRead(), we will never receive the OnClose() callback. Additionally, OnClose() will reset the stream, so there is no need to call ResetStream() here. I don't think this will cause a bug right now, since QuicHttpStream only supports request/response, but resetting stream here isn't right if QuicHttpStream supports bidirectional streaming in the future.

int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) {
  int rv = stream_->Read(buf, buf_len);
  if (stream_->IsDoneReading()) {
    stream_->SetDelegate(nullptr);   // <-- should be removed??
    stream_->OnFinRead();
    ResetStream();                   // <-- should be removed??
  }
  return rv;
}

 

Sign in to add a comment