Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quic: next iteration #48244

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
quic: address review comments
  • Loading branch information
jasnell committed Dec 9, 2023
commit d8fe4e74b9e0ef5b93587458a87b6a2374104c68
12 changes: 4 additions & 8 deletions src/quic/streams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,7 @@ void Stream::EntryRead(size_t amount) {
// Tells us that amount bytes were read from inbound_
// We use this as a signal to extend the flow control
// window to receive more bytes.
if (is_destroyed()) return;
if (session_) session_->ExtendStreamOffset(id(), amount);
if (!is_destroyed() && session_) session_->ExtendStreamOffset(id(), amount);
}

int Stream::DoPull(bob::Next<ngtcp2_vec> next,
Expand Down Expand Up @@ -855,9 +854,8 @@ void Stream::BeginHeaders(HeadersKind kind) {
}

bool Stream::AddHeader(const Header& header) {
if (is_destroyed()) return false;
size_t len = header.length();
if (!session_->application().CanAddHeader(
if (is_destroyed() || !session_->application().CanAddHeader(
headers_.size(), headers_length_, len)) {
return false;
}
Expand Down Expand Up @@ -889,8 +887,7 @@ void Stream::Acknowledge(size_t datalen) {
}

void Stream::Commit(size_t datalen) {
if (is_destroyed() || outbound_ == nullptr) return;
outbound_->Commit(datalen);
if (!is_destroyed() && outbound_) outbound_->Commit(datalen);
}

void Stream::EndWritable() {
Expand Down Expand Up @@ -1039,9 +1036,8 @@ void Stream::EmitWantTrailers() {
// ============================================================================

void Stream::Schedule(Stream::Queue* queue) {
if (is_destroyed() || outbound_ == nullptr) return;
// If this stream is not already in the queue to send data, add it.
if (stream_queue_.IsEmpty()) queue->PushBack(this);
if (!is_destroyed() && outbound_ && stream_queue_.IsEmpty()) queue->PushBack(this);
}

void Stream::Unschedule() {
Expand Down