Skip to content

Commit 157417a

Browse files
committed
fixup! quic: extract transport logic from Application to Session
Fix preexisting bug in TryWritePendingDatagram
1 parent 423e261 commit 157417a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/quic/session.cc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,14 @@ ssize_t Session::TryWritePendingDatagram(PathStorage* path,
18181818
Debug(this, "Datagram %" PRIu64 " not accepted into packet", dg.id);
18191819
}
18201820

1821+
// ngtcp2 can return a positive number if the packet was nearly full, and so
1822+
// it finalized without waiting for more. This isn't an error, and can happen
1823+
// with or without `accepted` being true (if false, it stays queued).
1824+
if (dg_nwrite > 0) {
1825+
if (!accepted) dg.send_attempts++;
1826+
return dg_nwrite;
1827+
}
1828+
18211829
switch (dg_nwrite) {
18221830
case 0: {
18231831
// If dg_nwrite is 0, we are either congestion controlled or

0 commit comments

Comments
 (0)