From 38bd31c6460efe74d46493e681caabe5fbad3738 Mon Sep 17 00:00:00 2001 From: Flavia Rainone Date: Tue, 10 Sep 2019 05:22:23 -0300 Subject: [PATCH] xnio#14 At AbstractXnioSocketChannel.doWrite, skip loop if there is a non BytBuf message to handle it properly --- .../org/xnio/netty/transport/AbstractXnioSocketChannel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/xnio/netty/transport/AbstractXnioSocketChannel.java b/src/main/java/org/xnio/netty/transport/AbstractXnioSocketChannel.java index 97e82fe..997c7e6 100644 --- a/src/main/java/org/xnio/netty/transport/AbstractXnioSocketChannel.java +++ b/src/main/java/org/xnio/netty/transport/AbstractXnioSocketChannel.java @@ -194,6 +194,9 @@ protected void doWrite(ChannelOutboundBuffer in) throws Exception { // Release the fully written buffers and update the indexes of the partially written buffer. for (int i = msgCount; i > 0; i --) { + if (in.current() != null && ! (in.current() instanceof ByteBuf)) { + break; + } final ByteBuf buf = (ByteBuf) in.current(); final int readerIndex = buf.readerIndex(); final int readableBytes = buf.writerIndex() - readerIndex; @@ -214,12 +217,9 @@ protected void doWrite(ChannelOutboundBuffer in) throws Exception { } incompleteWrite(setOpWrite); - break; } - continue; } } - Object msg = in.current(); if (msg == null) { // Wrote all messages.