diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java index d63d4df7c8..d7a7940f38 100755 --- a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java @@ -1651,7 +1651,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements } private void flush(ByteBuf out) { - while (out.isWritable()) { + while (out.maxCapacity() != out.writerIndex()) { ByteBuf data = exchangeBuf.peek(); if (data == null) { break;