Skip to content

Commit 29a465d

Browse files
authored
WritabilityChanged event is triggered with wrong capacity (#748)
Motivation: There was a regression in `fdb1a7` (00.63.Final) where `writeQueued()` may call `updateWritabilityIfNeeded(true)` at the end of the loop, even when no write operations were completed. As a result, the channel capacity is zero. That has an impact on handlers that intercept the WritabilityChanged events and call `Channel.bytesBeforeUnwritable()`. Modifications: Only call `updateWritabilityIfNeeded(true)` if `written` is true. Result: Handlers that intercept WritabilityChanged events see the correct capacity.
1 parent acff4b9 commit 29a465d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicStreamChannel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ boolean writeQueued() {
681681
queue.remove().setFailure(e);
682682
}
683683
}
684-
updateWritabilityIfNeeded(true);
684+
if (written) {
685+
updateWritabilityIfNeeded(true);
686+
}
685687
return written;
686688
} finally {
687689
closeIfNeeded(wasFinSent);

0 commit comments

Comments
 (0)