From f2ce28bf18368edcfb285fe76b64aca36dd077e7 Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Wed, 13 Jul 2016 18:36:58 +0000 Subject: [PATCH] Satisfy write promise when writing an Http2WindowUpdateFrame to Http2FrameCodec. Motivation: When writing an Http2WindowUpdateFrame to an Http2FrameCodec, the ChannelPromise is never satisfied, so callers cannot generically rely on the write future being satisfied on success. Modifications: When writing Http2WindowUpdateFrame, Http2FrameCodec now satisfies the ChannelPromise immediately. Result: The write future is satisfied on successful writes. Fixes netty/netty#5530. --- .../main/java/io/netty/handler/codec/http2/Http2FrameCodec.java | 1 + 1 file changed, 1 insertion(+) diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java index 24688f6b42..23769cfc9a 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java @@ -142,6 +142,7 @@ public class Http2FrameCodec extends ChannelDuplexHandler { if (msg instanceof Http2WindowUpdateFrame) { Http2WindowUpdateFrame frame = (Http2WindowUpdateFrame) msg; consumeBytes(frame.streamId(), frame.windowSizeIncrement()); + promise.setSuccess(); } else if (msg instanceof Http2StreamFrame) { writeStreamFrame((Http2StreamFrame) msg, promise); } else if (msg instanceof Http2GoAwayFrame) {