quic: fixup quic stream variable chunk len · nodejs/node@575dc7d · GitHub
Skip to content

Commit 575dc7d

Browse files
jasnelladuh95
authored andcommitted
quic: fixup quic stream variable chunk len
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #63230 Backport-PR-URL: #64675 Fixes: #63216 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 2551f9e commit 575dc7d

3 files changed

Lines changed: 110 additions & 16 deletions

File tree

lib/internal/quic/quic.js

Lines changed: 15 additions & 14 deletions

src/quic/streams.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,10 @@ void Stream::UpdateWriteDesiredSize() {
15921592
uint32_t old_size = state_->write_desired_size;
15931593
state_->write_desired_size = clamped;
15941594

1595-
// Fire drain when transitioning from 0 to non-zero
1596-
if (old_size == 0 && desired > 0) {
1595+
// Fire drain when transitioning from 0 to non-zero.
1596+
// writeDesiredSize == 0 means the buffer is full or flow control is
1597+
// exhausted, so the JS side may be waiting for capacity.
1598+
if (old_size == 0 && clamped > 0) {
15971599
EmitDrain();
15981600
}
15991601
}
Lines changed: 91 additions & 0 deletions

0 commit comments

Comments
 (0)