Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
quic: minor cleanups
Browse files Browse the repository at this point in the history
PR-URL: #217
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Dec 5, 2019
1 parent 23675f2 commit 700ab33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/node_quic_default_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ bool DefaultApplication::ReceiveStreamData(
// empty stream frames to commit resources. Check that
// here. Essentially, we only want to create a new stream
// if the datalen is greater than 0, otherwise, we ignore
// the packet.
if (datalen == 0)
// the packet. ngtcp2 should be handling this for us,
// but we handle it just to be safe.
if (UNLIKELY(datalen == 0))
return true;

stream = Session()->CreateStream(stream_id);
Expand All @@ -62,7 +63,7 @@ void DefaultApplication::AcknowledgeStreamData(
Debug(Session(), "Default QUIC Application acknowledging stream data");
// It's possible that the stream has already been destroyed and
// removed. If so, just silently ignore the ack
if (stream)
if (stream != nullptr)
stream->AckedDataOffset(offset, datalen);
}

Expand Down Expand Up @@ -126,7 +127,7 @@ bool DefaultApplication::SendStreamData(QuicStream* stream) {
size_t remaining = stream->DrainInto(&vec);
Debug(stream, "Sending %d bytes of stream data. Still writable? %s",
remaining,
stream->IsWritable()?"yes":"no");
stream->IsWritable() ? "yes" : "no");

// c and v are used to track the current serialization position
// for each iteration of the for(;;) loop below.
Expand Down

0 comments on commit 700ab33

Please sign in to comment.